{"id":857,"url":"https://github.com/youkchansim/CSPieChart","last_synced_at":"2025-07-30T19:32:30.607Z","repository":{"id":56905181,"uuid":"78025088","full_name":"youkchansim/CSPieChart","owner":"youkchansim","description":"This is pie chart that is very easy to use and customizable design.","archived":false,"fork":false,"pushed_at":"2019-03-18T15:54:49.000Z","size":7260,"stargazers_count":41,"open_issues_count":1,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-07T20:44:02.590Z","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/youkchansim.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":"2017-01-04T14:57:34.000Z","updated_at":"2024-04-19T06:05:56.000Z","dependencies_parsed_at":"2022-08-21T02:50:33.298Z","dependency_job_id":null,"html_url":"https://github.com/youkchansim/CSPieChart","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youkchansim%2FCSPieChart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youkchansim%2FCSPieChart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youkchansim%2FCSPieChart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/youkchansim%2FCSPieChart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/youkchansim","download_url":"https://codeload.github.com/youkchansim/CSPieChart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228178896,"owners_count":17881105,"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-01-05T20:15:33.134Z","updated_at":"2024-12-04T19:32:01.928Z","avatar_url":"https://github.com/youkchansim.png","language":"Swift","funding_links":[],"categories":["Charts"],"sub_categories":["Other free courses","Getting Started"],"readme":"# CSPieChart\n\n![Carthage compatible](https://img.shields.io/badge/Carthage-Compatible-brightgreen.svg?style=flat)\n[![Version](https://img.shields.io/cocoapods/v/CSPieChart.svg?style=flat)](http://cocoapods.org/pods/CSPieChart)\n[![License](https://img.shields.io/cocoapods/l/CSPieChart.svg?style=flat)](http://cocoapods.org/pods/CSPieChart)\n![iOS 8.3+](https://img.shields.io/badge/iOS-8.3%2B-blue.svg)\n![Swift 4.2+](https://img.shields.io/badge/Swift-4.2%2B-orange.svg)\n\n![](Example/ReadMeResource/gif1.gif)\n![](Example/ReadMeResource/gif2.gif)\n![](Example/ReadMeResource/gif3.gif)\n![](Example/ReadMeResource/gif4.gif)\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Requirements\n\n## Installation\n\nCSPieChart is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"CSPieChart\"\n```\n\n## Useage\n\n![](Example/ReadMeResource/view1.png)\n![](Example/ReadMeResource/view2.png)\n![](Example/ReadMeResource/view3.png)\n\nFirst Step  - `import CSPieChart` to your project\n\nSecond Step - You should `CSPieChartData`. This is model for piechart.\n```Swift\n  let data = CSPieChartData(key: \"test\", value: 70)\n```\n\nThird Step - Add a delegate `CSPieChartDataSource` \u0026 `CSPieChartDelegate` to your class \u0026 add two delegate methods \n```Swift\npublic protocol CSPieChartDataSource {\n\n    ///  Component data\n    func numberOfComponentData() -\u003e Int\n    func pieChart(_ pieChart: CSPieChart, dataForComponentAt index: Int) -\u003e CSPieChartData\n\n    ///  Component colors\n    func numberOfComponentColors() -\u003e Int\n    func pieChart(_ pieChart: CSPieChart, colorForComponentAt index: Int) -\u003e UIColor\n\n    ///  If you are implement this, you can show subView. example) 'UIImageView' or 'UILable'\n    @objc optional func numberOfComponentSubViews() -\u003e Int\n    @objc optional func pieChart(_ pieChart: CSPieChart, viewForComponentAt index: Int) -\u003e UIView\n\n    ///  If you are implement this, you apply color to line path\n    ///  Otherwish line color is applied default 'black'\n    @objc optional func numberOfLineColors() -\u003e Int\n    @objc optional func pieChart(_ pieChart: CSPieChart, lineColorForComponentAt index: Int) -\u003e UIColor\n}\n```\n```Swift\npublic protocol CSPieChartDelegate {\n\n    /// Component select\n    @objc optional func pieChart(_ pieChart: CSPieChart, didSelectComponentAt index: Int)\n}\n```\n\nYou can set some options\n\n```Swift\n    //  Pie chart radius rate that is percentage of frames in the superview. default is 0.7\n    public var pieChartRadiusRate: CGFloat = 0.7\n    \n    // Pie chart line length between component and subview. default is 10\n    public var pieChartLineLength: CGFloat = 10\n    \n    //  This is piechart component selecting animation. default is none\n    public var seletingAnimationType: SelectingAnimationType = .none\n}\n```\n\nLast Step - You must call `show`.\n### Example\n```Swift\n  func ViewDidLoad(...) {\n      ....\n      pieChart.show(animated: true)\n  }\n```\n\n\nIf you need more information, check example\n\n## Author\n\nchansim.youk, dbrckstla@naver.com\n\n## License\n\nCSPieChart is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoukchansim%2FCSPieChart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoukchansim%2FCSPieChart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoukchansim%2FCSPieChart/lists"}