{"id":20431057,"url":"https://github.com/mallikarjunh/charts_examples","last_synced_at":"2025-04-12T20:33:55.087Z","repository":{"id":151467743,"uuid":"198991472","full_name":"MallikarjunH/Charts_Examples","owner":"MallikarjunH","description":"Line Chart, Bar Chart and Pie Charts","archived":false,"fork":false,"pushed_at":"2019-10-23T07:27:25.000Z","size":1236,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T14:50:46.927Z","etag":null,"topics":["barchart","charts","cocoapods","ios","linechart","pie-charts","swift"],"latest_commit_sha":null,"homepage":null,"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/MallikarjunH.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-07-26T09:47:26.000Z","updated_at":"2024-08-20T03:39:32.000Z","dependencies_parsed_at":"2023-05-05T18:31:18.442Z","dependency_job_id":null,"html_url":"https://github.com/MallikarjunH/Charts_Examples","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/MallikarjunH%2FCharts_Examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MallikarjunH%2FCharts_Examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MallikarjunH%2FCharts_Examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MallikarjunH%2FCharts_Examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MallikarjunH","download_url":"https://codeload.github.com/MallikarjunH/Charts_Examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248630414,"owners_count":21136435,"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":["barchart","charts","cocoapods","ios","linechart","pie-charts","swift"],"created_at":"2024-11-15T08:09:59.702Z","updated_at":"2025-04-12T20:33:55.082Z","avatar_url":"https://github.com/MallikarjunH.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Line Chart, Bar Chart and Pie Charts Examples**\n\n**Library**: https://github.com/danielgindi/Charts\n\n\n**Example 1 - 7** -Output Screens\n\n![1](https://user-images.githubusercontent.com/27955299/62760603-0271ee00-baa2-11e9-98a2-6bda66c94d92.jpg)\n\n![2](https://user-images.githubusercontent.com/27955299/62760612-0b62bf80-baa2-11e9-8e75-11b1ceb8c484.jpg)\n**Example 7** - Line-Chart_3_Final4_Swift4 - This example work fine with swift 4\n\n**Following line/code is not available after 4.0 versions** (i.e 4.2, 5.0 swift verions)\n\n        chartViewOutlet.xAxis.valueFormatter = IndexAxisValueFormatter(value: months)\n      \n**Solutions**: - You need to add following code in order to show values on X- Axis\n\n        let customFormater = CustomFormatter()\n        customFormater.labels =  months\n        chartViewOutlet.xAxis.valueFormatter = customFormater\n      \nand write seperate class like below,     \n  \n    final class CustomFormatter: IAxisValueFormatter{\n        var labels: [String] = []\n        func stringForValue(_ value: Double, axis: AxisBase?) -\u003e String {\n        \n            let count = self.labels.count\n        \n            guard let axis = axis, count \u003e 0 else {\n                return \"\"\n            }\n        \n            let factor = axis.axisMaximum / Double(count)\n        \n            let index = Int((value / factor).rounded())\n        \n            if index \u003e= 0 \u0026\u0026 index \u003c count {\n                return self.labels[index]\n            }\n        \n            return \"\"\n        }\n     }\n\n\n**Bar Chart** - Output Screens\n\n![3](https://user-images.githubusercontent.com/27955299/62760620-0f8edd00-baa2-11e9-8fb7-e01b94fbf72a.jpg)\n\n**Pie Chart** - Output Screen\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmallikarjunh%2Fcharts_examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmallikarjunh%2Fcharts_examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmallikarjunh%2Fcharts_examples/lists"}