{"id":24559492,"url":"https://github.com/emrearmagan/simplecharts","last_synced_at":"2025-04-19T12:12:12.830Z","repository":{"id":57663363,"uuid":"371797739","full_name":"emrearmagan/SimpleCharts","owner":"emrearmagan","description":"A simple charting library for iOS.","archived":false,"fork":false,"pushed_at":"2025-01-04T18:00:38.000Z","size":2333,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T00:02:38.184Z","etag":null,"topics":["animated","barchart","charts","customizable","groupchart","ios","linechart","rangechart","simple","swift"],"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/emrearmagan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-28T19:15:39.000Z","updated_at":"2025-01-04T18:00:41.000Z","dependencies_parsed_at":"2022-09-16T19:11:02.516Z","dependency_job_id":null,"html_url":"https://github.com/emrearmagan/SimpleCharts","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/emrearmagan%2FSimpleCharts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrearmagan%2FSimpleCharts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrearmagan%2FSimpleCharts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrearmagan%2FSimpleCharts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emrearmagan","download_url":"https://codeload.github.com/emrearmagan/SimpleCharts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249691331,"owners_count":21311334,"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":["animated","barchart","charts","customizable","groupchart","ios","linechart","rangechart","simple","swift"],"created_at":"2025-01-23T06:16:45.279Z","updated_at":"2025-04-19T12:12:12.805Z","avatar_url":"https://github.com/emrearmagan.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\r\n\u003cdiv\u003e\r\n\u003cimg align=\"right\" width=\"50\" height=\"50\" src=\"./SimpleChartsDemo/SupportFiles/Preview/appicon.png\" alt=\"project app icon\"\u003e\r\n\r\n## SimpleCharts\r\n\u003c/div\u003e\r\n\r\n\u003c!--https://raw.githubusercontent.com/emrearmagan/SimpleCharts/main/SimpleChartsDemo/Assets.xcassets/AppIcon.appiconset/barchart-40@2x.png--\u003e\r\n\r\n![Commit](https://img.shields.io/github/last-commit/emrearmagan/SimpleCharts)\r\n![Platform](https://img.shields.io/badge/platform-ios-lightgray.svg)\r\n![Swift 5.0](https://img.shields.io/badge/Swift-5.0-orange.svg)\r\n![iOS 13.0+](https://img.shields.io/badge/iOS-13.0%2B-blue.svg)\r\n![MIT](https://img.shields.io/github/license/mashape/apistatus.svg)\r\n\r\n----\r\n\r\n\u003cbr\u003e\r\n\u003cp\u003e\r\n  \u003csamp\u003e\r\nA simple charting library for iOS.\r\n  \u003c/samp\u003e\r\n\u003c/p\u003e\r\n\r\n- 📊 Bar charts\r\n- 📚 Grouped Bar charts\r\n- 🧮 Range Bar Charts\r\n- 📈 Minimalistic Line chart\r\n- 🖖 Touch events\r\n- ✨ Bar charts are fully customizable and animated\r\n\r\n---\r\n### 💻 Table of contents\r\n  1. [Quick Start](#quickStart)\r\n      1. [Bar chart](#barChart)\r\n      2. [Range chart](#rangeChart)\r\n      3. [Group chart](#groupChart)\r\n      4. [Line chart](#lineChart)\r\n      5. [Configuring touch events](#touchEvent)\r\n  2. [Chart options](#chartOptions)\r\n  3. [Getting started](#gettingStarted)\r\n  4. [Contribute](#contribute)\r\n\r\n\r\n### Quick start \u003ca name=\"quickStart\"\u003e\u003c/a\u003e\r\n\r\n###### Bar chart: \u003ca name=\"barChart\"\u003e\u003c/a\u003e\r\n\u003cp align=\"center\"\u003e\r\n  \u003cimg src=\"./SimpleChartsDemo/SupportFiles/Preview/barChart.gif\" alt=\"BarChart\" width= 50%\u003e\r\n\u003c/p\u003e\r\n\r\n```swift\r\nlet chart = BarChartView()\r\nchart.setBarChartOptions([\r\n      .showYAxis(false),\r\n      .showXAxis(false),\r\n      .showAvgLine(false),\r\n      .backgroundColor(.clear),\r\n      .showScrollIndicator(false),\r\n      .showHorizontalLines(false),\r\n      .isScrollable(false),\r\n      ], barOptions: [\r\n          .containerColor(.gray.withAlphaComponent(0.1))])\r\n\r\nchart.entries = [\r\n  BarEntryModel(value: 50, color: .purpleColor, label: \"first\"),\r\n  BarEntryModel(value: 20, color: .purpleColor, label: \"second\")]\r\n\r\nself.view.addSubview(chart)\r\n```\r\n\r\n###### Range chart: \u003ca name=\"rangeChart\"\u003e\u003c/a\u003e\r\n\u003cp align=\"center\"\u003e\r\n  \u003cimg src=\"./SimpleChartsDemo/SupportFiles/Preview/rangeChart.gif\" alt=\"RangeChart\" width= 50%\u003e\r\n\u003c/p\u003e\r\n\r\n```swift\r\nlet chart = RangeBarChartView()\r\nchart.setBarChartOptions([\r\n      .xAxisFont(UIFont.systemFont(ofSize: 10, weight: .medium)),\r\n      .yAxisFont(.systemFont(ofSize: 12, weight: .bold)),\r\n      .axisTintColor(.gray),\r\n      .showYAxis(false),\r\n      .showXAxis(true),\r\n      .avgTintColor(.orange.withAlphaComponent(0.7)),\r\n      .backgroundColor(.clear),\r\n      .minSpacing(18),\r\n      ], barOptions: [\r\n          .cornerRounding(5)])\r\n\r\nchart.entries = [\r\n    RangeBarEntryModel(value: 20, min: 10, max: 22, color: .orange, label: \"Sep.\"),\r\n    RangeBarEntryModel(value: 15, min: 8, max: 30, color: .orangeColor, label: \"Oct.\")]\r\n\r\nself.view.addSubview(chart)\r\n```\r\n\r\n###### Group chart: \u003ca name=\"groupChart\"\u003e\u003c/a\u003e\r\n\r\n\u003cp align=\"center\"\u003e\r\n  \u003cimg src=\"./SimpleChartsDemo/SupportFiles/Preview/groupChart.gif\" alt=\"GroupChart\" width= 50%\u003e\r\n\u003c/p\u003e\r\n\r\n```swift\r\nlet chart = GroupedBarChartView()\r\nchart.setGroupBarChartOptions([\r\n      .showXAxis(true),\r\n      .showYAxis(true),\r\n      .showAvgLine(false),\r\n      .showScrollIndicator(false),\r\n      .scrollViewWidthInsets(21),\r\n      .horizontalLineTintColor(.lightGray.withAlphaComponent(0.5)),\r\n      .axisTintColor(.gray)]\r\n      ,groupBarOptions: [\r\n          .barchartOptions([\r\n          .minBarWidth(36),\r\n          .cornerRounding(5),\r\n          .containerColor(.clear)]),\r\n            .groupSpacing(30)])\r\n\r\nchart.yAxisFormatter = { (value: Double) in\r\n      return getShortedString(num: value)\r\n}\r\n\r\nchart.entries = [\r\n    GroupedEntryModel(entries: [\r\n        BarEntryModel(value: 5214, color: .blue, label: \"Facebook\"),\r\n        BarEntryModel(value: 4541, color: .blue, label: \"Facebook\")], label: \"Facebook\"),\r\n\r\n    GroupedEntryModel(entries: [\r\n        BarEntryModel(value: 653, color: .darkGray, label: \"Github\"),\r\n        BarEntryModel(value: 123, color: .darkGray, label: \"Github\")], label: \"Github\"),\r\n]\r\n\r\nself.view.addSubview(chart)\r\n```\r\n\r\n###### Line chart (Beta): \u003ca name=\"lineChart\"\u003e\u003c/a\u003e\r\n\u003cp align=\"center\"\u003e\r\n  \u003cimg src=\"./SimpleChartsDemo/SupportFiles/Preview/lineChart.gif\" alt=\"LineChart\" width= 50%\u003e\r\n\u003c/p\u003e\r\n\r\n```swift\r\nlet chart = LineChartView()\r\nchart.dataPoints = [\r\n    LineChartEntryModel(value: 105, date: Date()),\r\n    LineChartEntryModel(value: 89, date: Date()),\r\n]\r\n\r\nself.view.addSubview(chart)\r\n```\r\n\r\n###### Configuring touch events \u003ca name=\"touchEvent\"\u003e\u003c/a\u003e\r\n\r\nTo make the chart respond to touch events, implement the `BarChartDelegate` protocol in your class, e.g. a View Controller, and then set the chart’s `delegate` property:\r\n\r\n```swift\r\nclass MyViewController: UIViewController, ChartDelegate {\r\n  override func viewDidLoad() {\r\n    let chart = BarChartView()\r\n    chart.delegate = self\r\n  }\r\n\r\n  // Chart delegate\r\n  func didSelect(selectedBar: Bar) {\r\n    // Do something on touch or customize the bar\r\n  }\r\n\r\n  func animationDidStartFor(bar: Bar) {\r\n    // Do something when animation started\r\n  }\r\n\r\n  func animationDidStopFor(bar: Bar) {\r\n    // Do something when animation ended\r\n  }\r\n}\r\n```\r\n\r\n\u003c!-- TODO: Add Information about Bar, BarContainer and BarContainerData --\u003e\r\n\r\n### Chart options \u003ca name=\"chartOptions\"\u003e\u003c/a\u003e\r\n\r\nChart Options (Currently not supported for LineChart):\r\n\r\n| Option Name                   | Description                                                                                                                                                                                                 |\r\n|-------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\r\n| `animationDuration`          | Duration of the animation for every Bar/line (`Double`, default `0.5`)                                                                                                                                                |\r\n| `animationDelay`                   | Delay of the animation for every Bar/Line inside the Chart (`Double`, default `0`)                                                                                                                                                          |\r\n| `showAvgLine`                 | Flag indicated whether to show the average line  (`Bool`, default `false`)\r\n| `avgTintColor`                 | Tint of the Average line  (`UIColor`, default `.systemBlue`)\r\n| `showHorizontalLines`                    | Flag indicated whether to show the horizontal lines (`Bool`, default `true`)\r\n| `horizontalLineTintColor`                 | Color of the horizontal lines  (`UIColor`, default `.lightGray`)                                                                                           |\r\n| `showYAxis`          | Flag indicated whether to show the yAxis (`Bool`, default `true`)                                                                      \r\n| `showXAxis`          | Flag indicated whether to show the xAxis (`Bool`, default `true`)                                                                            |\r\n| `axisTintColor`                 | Foreground color of the axis labels  (`UIColor`, default `.label`)\r\n| `xAxisFont`                 | Font of the x-axes values (`UIFont`, default `.systemFont(ofSize: 12)`)\r\n| `yAxisFont`                 | Font of the y-axes values (`UIFont`, default `.systemFont(ofSize: 12)`)\r\n| `yAxisFormatter`          | Closure for formatting the y axis values (`((Double) -\u003e String)`, default `0.5`)                                                                                                                                                  |\r\n| `maxVisibleCount` | Maximal visible entries (`Bool?`)                                                                                         |\r\n| `minEntryCount`                   | Minimum number of entries. If there are less  entries than specified here, a minimum amout of entries will be added (`Int?`)                                                                                                                                                          |\r\n| `minSpacing`                  | Minimum spacing between each bar (`CGFLoat?`)                                                                                                                                                       |\r\n| `leftSpacing`                   | Spacing for the yAxis values (`CGFLoat `, default `20 `)                                                                                                                                                                    |\r\n| `autoFormatXAxis`                   | If set to true number of x-axis labels will be set according to width (`Bool`, default `true`)                                                                                                                                                     |\r\n| `scrollViewWidthInsets`                        | Insets of the scrollView, only if scrollView is enabled (`CGFloat`, default `0`) |\r\n\r\nBar, group and range Chart:\r\n\r\n| Option Name                   | Description                                                                                                                                                                                                 |\r\n|-------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\r\n| `minBarWidth`          | Minimum width of each Bar (`CGFloat?`)                                                                                                                                                |\r\n| `markSelected`                   | Flag whether the entry should be marked as selected (`Bool`, default `true`)                                                                                                                                                          |\r\n| `containerColor`                 | If set the barContainer will have a background color  (`UIColor?`)\r\n| `cornerRounding`                 | Rounding of each Bar  (`CGFloat`, default `5`)\r\n| `delegate`          | The delegate to listen to touch events (`BarChartDelegate`) |\r\n\r\nRange Chart:\r\n\r\n| Option Name                   | Description                                                                                                                                                                                                 |\r\n|-------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\r\n| `minBarAlphaValue`          | Alpha vaue for the color of the min bar (`CGFloat`, default `0.4`)                                                                                                                                                |\r\n| `minMaxspacing`                   | Spacing between the min and max bar (`CGFloat`, default `5`) |\r\n\r\nGroup Chart:\r\n\r\n| Option Name                   | Description                                                                                                                                                                                                 |\r\n|-------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\r\n| `groupSpacing`          | Spacing between each group (`CGFloat`, default `10`) |\r\n\r\n### Installation \u003ca name=\"gettingStarted\"\u003e\u003c/a\u003e\r\n\r\n##### CocoaPods\r\nYou can use CocoaPods to install SimpleCharts by adding it to your Podfile:\r\n\r\n    pod 'SimpleCharts'\r\n\r\n##### Installing SimpleCharts manually \u003ca name=\"manually\"\u003e\u003c/a\u003e\r\n1. Download SimpleCharts.zip from the last release and extract its content in your project's folder.\r\n2. From the Xcode project, choose Add Files to ... from the File menu and add the extracted files.\r\n\r\n### Contribute \u003ca name=\"contribute\"\u003e\u003c/a\u003e\r\nContributions are highly appreciated! To submit one:\r\n1. Fork\r\n2. Commit changes to a branch in your fork\r\n3. Push your code and make a pull request\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femrearmagan%2Fsimplecharts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femrearmagan%2Fsimplecharts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femrearmagan%2Fsimplecharts/lists"}