{"id":22368512,"url":"https://github.com/wouter125/chart","last_synced_at":"2025-03-26T16:13:05.767Z","repository":{"id":185846609,"uuid":"264735133","full_name":"Wouter125/Chart","owner":"Wouter125","description":"Fully customizable line chart in Swift","archived":false,"fork":false,"pushed_at":"2020-06-29T12:41:08.000Z","size":35,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-31T17:57:32.911Z","etag":null,"topics":["animation","graph","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/Wouter125.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,"governance":null}},"created_at":"2020-05-17T18:52:31.000Z","updated_at":"2020-06-29T12:41:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"24079e3b-a063-47cc-b9ba-97d2b62a3c60","html_url":"https://github.com/Wouter125/Chart","commit_stats":null,"previous_names":["wouter125/chart"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wouter125%2FChart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wouter125%2FChart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wouter125%2FChart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wouter125%2FChart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Wouter125","download_url":"https://codeload.github.com/Wouter125/Chart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245689512,"owners_count":20656417,"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":["animation","graph","swift"],"created_at":"2024-12-04T18:34:26.255Z","updated_at":"2025-03-26T16:13:05.746Z","avatar_url":"https://github.com/Wouter125.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Line Chart\n\nLine Chart is a simple and light-weight line chart component for iOS. It's fully written in Swift, based upon UIView, and highly customizable. It currently supports the following features;\n\n- [x] Bezier Curves\n- [x] Linear Curves\n- [x] Touch Tracking for linear and bezier curves\n- [x] Fully customizable axes\n- [x] Graph points\n- [x] Animation control when switching between data sets\n\n## How to install\n\nCurrently Line Chart is only available through the [Swift Package Manager](https://swift.org/package-manager/) or manual install. \n\n1. Installation through Swift Package Manager can be done by going to `File \u003e Swift Packages \u003e Add Package Dependency`. Then enter the following line;\n```https://github.com/Wouter125/Chart```\n\n2. Manual installation can be done by cloning this repository and dragging all assets into your Xcode Project.\n\n## How to use\n\nTo give you an idea of how to configure the line chart here are two examples. For more details see [parameters](#parameters).\n\n**Linear line with graph points and axes**\n```\nprivate let graph: LineChart = {\n    let graph = LineChart()\n    graph.lineType = .linear\n    \n    graph.isAnimated = false\n\n    graph.axesConfiguration.x.isHidden = false\n    graph.axesConfiguration.y.isHidden = false\n\n    graph.inset = UIEdgeInsets(top: 0, left: 48, bottom: 0, right: 24)\n    graph.showPoints = true\n\n    return graph\n}()\n```\n\n**Bezier line with custom animation curves**\n```\nprivate let graph: LineChart = {\n    let graph = LineChart()\n    graph.lineType = .bezier\n    \n    graph.isAnimated = true\n    graph.animationCurve = .easeInEaseOut\n    graph.animationDuration = 1.5\n    \n    return graph\n}()\n```\n\n## Parameters\n\n### Graph\n\n| Parameter              | Type        | Default                                            | Description                                                                                 |\n|------------------------|-------------|----------------------------------------------------|---------------------------------------------------------------------------------------------|\n| data                   | [CGPoint]   | nil                                                | The data that you want to render on the graph canvas                                        |\n| inset                  | UIEdgeInset | UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) | Apply additional insets on your graph canvas                                                |\n| isTouchTrackingEnabled | Bool        | true                                               | Enable or disable the ability to pan on the graph to retrieve the data on the touched point |\n\n\n### Axes\nAxes uses a `struct` called `AxesConfiguration` which consists out of the following options;\n\n| Parameter  | Type    | Default                           | Description                                                                               |\n|------------|---------|-----------------------------------|-------------------------------------------------------------------------------------------|\n| x          | xAxis   | xAxis(isHidden: true, count: nil) | Defines whether the x axis should be shown, and if show how many of them there should be. |\n| y          | yAxis   | yAxis(isHidden: true, count: nil) | Defines whether the x axis should be shown, and if show how many of them there should be. |\n| color      | CGColor | UIColor.systemGray5.cgColor       | The color of the axes                                                                     |\n| width      | CGFloat | 1.0                               | The width of the axes                                                                     |\n| labelColor | CGColor | UIColor.systemGray.cgColor        | The color of the labels of the axes                                                       |\n\n\n### Line\n\n| Parameter        | Type      | Default                             | Description                                                                |\n|------------------|-----------|-------------------------------------|----------------------------------------------------------------------------|\n| lineType         | LineType  | .linear                             | Whether you want your data to render as a `.linear` line or `.bezier` line |\n| lineColor        | CGColor   | UIColor.systemGreen.cgColor         | The color of the line                                                      |\n| lineWidth        | CGFloat   | 2.0                                 | The width of the line                                                      |\n| showBackground   | Bool      | true                                | Show a gradient or solid color below the line                              |\n| backgroundColors | [CGColor] | [systemGreen(0.24), systemGreen(0)] | The colors for the gradient or solid color below the line                  |\n\n### Points\n\n| Parameter         | Type    | Default                     | Description                                                     |\n|-------------------|---------|-----------------------------|-----------------------------------------------------------------|\n| showPoints        | Bool    | false                       | Whether you want to show points at the data points you provided |\n| pointsFillColor   | CGColor | UIColor.white.cgColor       | The fill color of the point                                     |\n| pointsBorderColor | CGColor | UIColor.systemGreen.cgColor | The border color of the point                                   |\n| pointsBorderWidth | CGFloat | 2.0                         | The border width of the point                                   |\n\n### Animation\n\n| Parameter         | Type                  | Default        | Description                                                                |\n|-------------------|-----------------------|----------------|----------------------------------------------------------------------------|\n| isAnimated        | Bool                  | true           | Whether you want to animate the layer when switching data sets             |\n| animationCurve    | CAMediaTimingFunction | easeInOutCubic | The animation curve you want to apply. A full overview can be found here;  |\n| animationDuration | Double                | 0.8            | The duration of the animation                                              |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwouter125%2Fchart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwouter125%2Fchart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwouter125%2Fchart/lists"}