{"id":862,"url":"https://github.com/zemirco/swift-linechart","last_synced_at":"2025-04-05T16:09:18.257Z","repository":{"id":18245715,"uuid":"21396868","full_name":"zemirco/swift-linechart","owner":"zemirco","description":"Line Chart library for iOS written in Swift","archived":false,"fork":false,"pushed_at":"2019-11-25T20:50:42.000Z","size":312,"stargazers_count":603,"open_issues_count":37,"forks_count":68,"subscribers_count":34,"default_branch":"master","last_synced_at":"2025-03-29T15:08:49.542Z","etag":null,"topics":["chart","linechart","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zemirco.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-07-01T17:41:19.000Z","updated_at":"2024-12-21T12:50:11.000Z","dependencies_parsed_at":"2022-07-13T06:30:31.232Z","dependency_job_id":null,"html_url":"https://github.com/zemirco/swift-linechart","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zemirco%2Fswift-linechart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zemirco%2Fswift-linechart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zemirco%2Fswift-linechart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zemirco%2Fswift-linechart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zemirco","download_url":"https://codeload.github.com/zemirco/swift-linechart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361691,"owners_count":20926643,"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":["chart","linechart","swift"],"created_at":"2024-01-05T20:15:33.265Z","updated_at":"2025-04-05T16:09:18.227Z","avatar_url":"https://github.com/zemirco.png","language":"Swift","funding_links":[],"categories":["Charts","Swift"],"sub_categories":["Other free courses","Getting Started"],"readme":"# Swift LineChart\n\n![line chart demo](https://s3.amazonaws.com/zeMirco/github/swift-linechart/gif30.gif)\n\n## Usage\n\n```swift\nvar lineChart = LineChart()\nlineChart.addLine([3, 4, 9, 11, 13, 15])\n```\n\n## Features\n\n- Super simple\n- Highly customizable\n- Auto scaling\n- Touch enabled\n- Area below lines\n\n## Properties\n\nBoth `x` and `y` properties are of type `Coordinate`.\nEach can be customized separately and has its own settings for labels, gridlines and axis.\n\n- `labels`: Labels\n- `grid`: Grid\n- `axis`: Axis\n\n`Labels` can be switched on and off and they can have custom values.\n\n- `visible`: Bool = `true`\n- `values`: [String] = `[]`\n\n`Grid` can also be switched on/off, has a custom color and you can specify how many gridlines\nyou'd like to show.\n\n- `visible`: Bool = `true`\n- `count`: CGFloat = `10`\n- `color`: UIColor = `UIColor(red: 238/255.0, green: 238/255.0, blue: 238/255.0, alpha: 1) // #eeeeee`\n\n`Axis` can be switched on/off, has a property to its color and you can specify how much the axis\nis inset from the border of your UIView.\n\n- `visible`: Bool = `true`\n- `color`: UIColor = `UIColor(red: 96/255.0, green: 125/255.0, blue: 139/255.0, alpha: 1) // 607d8b`\n- `inset`: CGFloat = `15`\n\nAnimations can be customized through the `Animation` settings.\n\n- `enabled`: Bool = `true`\n- `duration`: CFTimeInterval = `1`\n\nIf you'd like to show extra dots at your data points use the `Dots` features.\n\n- `visible`: Bool = `true`\n- `color`: UIColor = `UIColor.whiteColor()`\n- `innerRadius`: CGFloat = `8`\n- `outerRadius`: CGFloat = `12`\n- `innerRadiusHighlighted`: CGFloat = `8`\n- `outerRadiusHighlighted`: CGFloat = `12`\n\nIn addition to the above mentioned features you can further customize your chart.\n\n- `area`: Bool = `true` - Fill the area between line and x axis\n- `lineWidth`: CGFloat = `2` - Set the line width\n- `colors`: [UIColor] = `[...]` - Colors for your line charts\n\n## Methods\n\nAdd line to chart.\n\n  `lineChart.addLine(data: [CGFloat])`\n\nRemove charts, areas and labels but keep axis and grid.\n\n  `lineChart.clear()`\n\nMake whole UIView white again\n\n  `lineChart.clearAll()`\n\n## Delegates\n\n`didSelectDataPoint()`\n\nTouch event happened at or close to data point.\n\n```swift\nfunc didSelectDataPoint(x: CGFloat, yValues: [CGFloat]) {\n  println(\"\\(x) and \\(yValues)\")\n}\n```\n\n## Examples\n\n#### Single line with default settings.\n\n![line chart demo](https://s3.amazonaws.com/zeMirco/github/swift-linechart/01.png)\n\n```swift\nvar lineChart = LineChart()\nlineChart.addLine([3, 4, 9, 11, 13, 15])\n```\n\n#### Two lines without grid and dots.\n\n![two lines without grid and dots](https://s3.amazonaws.com/zeMirco/github/swift-linechart/02.png)\n\n```swift\nvar lineChart = LineChart()\nlineChart.area = false\nlineChart.x.grid.visible = false\nlineChart.x.labels.visible = false\nlineChart.y.grid.visible = false\nlineChart.y.labels.visible = false\nlineChart.dots.visible = false\nlineChart.addLine([3, 4, 9, 11, 13, 15])\nlineChart.addLine([5, 4, 3, 6, 6, 7])\n```\n\n#### Show x and y axis\n\n![chart with x and y axis](https://s3.amazonaws.com/zeMirco/github/swift-linechart/04.png)\n\n```swift\nvar lineChart = LineChart()\nlineChart.area = false\nlineChart.x.grid.count = 5\nlineChart.y.grid.count = 5\nlineChart.addLine([3, 4, 9, 11, 13, 15])\nlineChart.addLine([5, 4, 3, 6, 6, 7])\n```\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzemirco%2Fswift-linechart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzemirco%2Fswift-linechart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzemirco%2Fswift-linechart/lists"}