{"id":17204748,"url":"https://github.com/tmdvs/coregraphicsgraph","last_synced_at":"2025-04-13T21:32:41.591Z","repository":{"id":19591693,"uuid":"22842120","full_name":"tmdvs/CoreGraphicsGraph","owner":"tmdvs","description":"Draw a line graph with CoreGraphics in Swift. This code is intended to be an example of how you could use CoreGraphics to draw graphs and other similar UI elements.","archived":false,"fork":false,"pushed_at":"2023-07-28T08:43:39.000Z","size":55,"stargazers_count":76,"open_issues_count":0,"forks_count":10,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-27T11:50:29.476Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tmdvs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-11T14:34:56.000Z","updated_at":"2025-02-24T08:08:48.000Z","dependencies_parsed_at":"2022-08-24T13:56:27.450Z","dependency_job_id":null,"html_url":"https://github.com/tmdvs/CoreGraphicsGraph","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmdvs%2FCoreGraphicsGraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmdvs%2FCoreGraphicsGraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmdvs%2FCoreGraphicsGraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmdvs%2FCoreGraphicsGraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmdvs","download_url":"https://codeload.github.com/tmdvs/CoreGraphicsGraph/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248786261,"owners_count":21161425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T02:23:02.474Z","updated_at":"2025-04-13T21:32:41.560Z","avatar_url":"https://github.com/tmdvs.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"CoreGraphicsGraph\n=================\n![Example](http://cl.ly/image/3M3y0A3w2C1F/d)\nDraw a line graph with CGPath and Swift. This is really just the result of playing with Swift, and so I can't garuntee the code is production ready, or even very good.\n\n```swift\n// GraphView.swift example usage\n\nlet myData = [\n    [\"Mon\" : 15],\n    [\"Tues\" : 30],\n    [\"Weds\" : 7],\n    [\"Thurs\" : 60],\n    [\"Fri\" : 30],\n    [\"Sat\" : 15],\n    [\"Sun\" : 45]\n]\n\nlet graph = GraphView(frame: CGRect(x: 50, y: 50, width: 420, height: 200), data: myData)\nself.view.addSubview(graph)\n```\n\n## Graph customisation options\nThere isn't really that many. The `GraphView` has a `style` property, the value of which is a `GraphStyle` struct which can be overriden.\n\n```swift\nstruct GraphStyle {\n \n    struct labels {\n        var font = UIFont.systemFont(ofSize: 10)\n        var color = UIColor.black\n    }\n    \n    struct colors {\n        var xAxis = UIColor.black\n        var yAxis = UIColor.black\n        var lines = UIColor.lightGray\n        var graph = UIColor.black\n    }\n    \n    var colors = colors()\n    var labels = labels()\n    \n    var showLines = true\n    var showPoints = true\n    \n    var xMargin : CGFloat = 20\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmdvs%2Fcoregraphicsgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmdvs%2Fcoregraphicsgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmdvs%2Fcoregraphicsgraph/lists"}