{"id":851,"url":"https://github.com/recruit-mtl/Graphs","last_synced_at":"2025-07-30T19:32:29.133Z","repository":{"id":56912959,"uuid":"60685162","full_name":"recruit-mtl/Graphs","owner":"recruit-mtl","description":"Light weight charts view generater for iOS. Written in Swift.","archived":false,"fork":false,"pushed_at":"2018-07-08T23:08:10.000Z","size":99,"stargazers_count":977,"open_issues_count":13,"forks_count":63,"subscribers_count":39,"default_branch":"master","last_synced_at":"2024-11-14T22:29:23.209Z","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/recruit-mtl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-08T09:16:56.000Z","updated_at":"2024-10-13T10:55:39.000Z","dependencies_parsed_at":"2022-08-21T03:20:31.899Z","dependency_job_id":null,"html_url":"https://github.com/recruit-mtl/Graphs","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recruit-mtl%2FGraphs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recruit-mtl%2FGraphs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recruit-mtl%2FGraphs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recruit-mtl%2FGraphs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/recruit-mtl","download_url":"https://codeload.github.com/recruit-mtl/Graphs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228178897,"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:32.939Z","updated_at":"2024-12-04T19:32:01.954Z","avatar_url":"https://github.com/recruit-mtl.png","language":"Swift","funding_links":[],"categories":["Charts","UI","Swift"],"sub_categories":["Other free courses","Getting Started"],"readme":"#\u003cimg src=\"https://s3-ap-northeast-1.amazonaws.com/graphs-mtl/graphs_logo.png\" width=\"100%\" alt=\"Graphs\" /\u003e\n[![Badge w/ Version](https://cocoapod-badges.herokuapp.com/v/Graphs/badge.png)](https://cocoadocs.org/docsets/Graphs)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)\n\n###Light weight charts view generater for iOS. Written in Swift.\n\n\u003cimg src=\"https://s3-ap-northeast-1.amazonaws.com/graphs-mtl/graphs_mock.png\" width=\"850\" alt=\"Graphs mock\" /\u003e\n\n## Requirements\n- iOS 8.0+\n- XCode 7.3+\n\n## Installation\n### [CocoaPods](https://cocoapods.org)\n```bash\n$ pod init\n```\n\nspecify it in your `Podfile`\n\n```ruby\nplatform :ios, '8.0'\n\ntarget 'TargetName' do\n\n  use_frameworks!\n  pod 'Graphs', '~\u003e 0.1.2'\n\nend\n```\n\nAnd run `CocoaPods`\n\n```bash\n$ pod install\n```\n\n--\n### [Carthage](https://github.com/Carthage/Carthage)\nYou can install Carthage with Homebrew.\n\n```bash\n$ brew update\n$ brew install carthage\n```\nspecify it in your `Cartfile`\n\n```\ngithub \"recruit-mtl/Graphs\"\n```\n\nAnd run `carthage`\n\n```bash\n$ carthage update --platform ios\n```\n\n## Usage\n\n#####import Graphs\n```swift\nimport Graphs\n```\n\n##### Range -\u003e GraphView (Bar)\n```swift\nlet view = (1 ... 10).barGraph(GraphRange(min: 0, max: 11)).view(viewFrame)\n```\n\u003cimg src=\"https://s3-ap-northeast-1.amazonaws.com/graphs-mtl/graphs1.png\" width=\"363\" /\u003e\n\n##### Array -\u003e GraphView (Line)\n```swift\nlet view = [10, 20, 4, 8, 25, 18, 21, 24, 8, 15].lineGraph(GraphRange(min: 0, max: 30)).view(viewFrame)\n```\n\u003cimg src=\"https://s3-ap-northeast-1.amazonaws.com/graphs-mtl/graphs2.png\" width=\"349\" /\u003e\n\n##### Dictionary -\u003e GraphView (Pie)\n```swift\nlet view = [\"a\": 3, \"b\": 8, \"c\": 9, \"d\": 20].pieGraph().view(viewFrame)\n```\n\n##### GraphData protocol -\u003e GraphView (Pie)\n```swift\nimport Graphs\n\nstruct Data\u003cT: Hashable, U: NumericType\u003e: GraphData {\n    typealias GraphDataKey = T\n    typealias GraphDataValue = U\n    \n    private let _key: T\n    private let _value: U\n    \n    init(key: T, value: U) {\n        self._key = key\n        self._value = value\n    }\n    \n    var key: T { get{ return self._key } }\n    var value: U { get{ return self._value } }\n}\n\nlet data = [\n    Data(key: \"John\", value: 18.9),\n    Data(key: \"Ken\", value: 32.9),\n    Data(key: \"Taro\", value: 15.3),\n    Data(key: \"Micheal\", value: 22.9),\n    Data(key: \"Jun\", value: 12.9),\n    Data(key: \"Hanako\", value: 32.2),\n    Data(key: \"Kent\", value: 3.8)\n]\n\nlet view = data.pieGraph() { (unit, totalValue) -\u003e String? in\n    return unit.key! + \"\\n\" + String(format: \"%.0f%%\", unit.value / totalValue * 100.0)\n}.view(viewFrame)\n```\n\u003cimg src=\"https://s3-ap-northeast-1.amazonaws.com/graphs-mtl/graphs3.png\" width=\"323\t\" /\u003e\n\n##### More detail\n-\u003e Read Playgrounds\n\n## Demo\n\n```bash\n$ git clone https://github.com/recruit-mtl/Graphs.git\n$ cd /path/to/Graphs/GraphsExample\n$ pod install\n```\nAnd Open ```GraphsExample.xcworkspace```\n\n## Issues\n### GraphView doesn't work on Interface builder.\nInterface Builder talks to code through the ObjC runtime. \nAnd ObjC doesn't do generics.\n\n## Licence\n\n[MIT](https://github.com/recruit-mtl/MTLLinkLabel/blob/master/LICENSE)\n\n## Author\n- [kokoron: Twitter](https://twitter.com/kokoron)\n- [kokoron: github](https://github.com/kokoron)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecruit-mtl%2FGraphs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frecruit-mtl%2FGraphs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecruit-mtl%2FGraphs/lists"}