{"id":841,"url":"https://github.com/xhacker/TEAChart","last_synced_at":"2025-07-30T19:32:20.884Z","repository":{"id":11766867,"uuid":"14302379","full_name":"xhacker/TEAChart","owner":"xhacker","description":"Simple and intuitive iOS chart library. Contribution graph, clock chart, and bar chart.","archived":false,"fork":false,"pushed_at":"2017-11-17T12:19:12.000Z","size":139,"stargazers_count":1194,"open_issues_count":0,"forks_count":135,"subscribers_count":41,"default_branch":"master","last_synced_at":"2024-11-29T21:35:22.765Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","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/xhacker.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":"2013-11-11T14:07:12.000Z","updated_at":"2024-10-23T03:03:10.000Z","dependencies_parsed_at":"2022-09-22T14:24:38.608Z","dependency_job_id":null,"html_url":"https://github.com/xhacker/TEAChart","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xhacker%2FTEAChart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xhacker%2FTEAChart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xhacker%2FTEAChart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xhacker%2FTEAChart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xhacker","download_url":"https://codeload.github.com/xhacker/TEAChart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228178890,"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.697Z","updated_at":"2024-12-04T19:31:59.105Z","avatar_url":"https://github.com/xhacker.png","language":"Objective-C","funding_links":[],"categories":["Charts","UI","Objective-C"],"sub_categories":["Other free courses","Getting Started"],"readme":"# TEAChart\n\n[![Travis CI](https://travis-ci.org/xhacker/TEAChart.svg)](https://travis-ci.org/xhacker/TEAChart)\n[![Version](https://img.shields.io/cocoapods/v/TEAChart.svg?style=flat)](http://cocoadocs.org/docsets/TEAChart/)\n[![License](https://img.shields.io/cocoapods/l/TEAChart.svg?style=flat)](https://github.com/xhacker/TEAChart/blob/master/LICENSE)\n[![Platform](https://img.shields.io/cocoapods/p/TEAChart.svg?style=flat)](http://cocoadocs.org/docsets/TEAChart/)\n\nSimple and intuitive iOS chart library, for [Pomotodo](https://pomotodo.com) app. **Contribution graph**, **clock chart**, and **bar chart**.\n\nSupports Storyboard and is fully accessible to VoiceOver users.\n\n## Usage\n\nThe most convinient way is to use Storyboard, where you can set the attributes right in the Interface Builder.\n\n\u003cimg alt=\"Interface Builder\" src=\"Screenshots/InterfaceBuilder.png\" width=\"277\"\u003e\n\nSee the header files for complete documents.\n\n### Contribution Graph\n\n![Contribution Graph](http://i.imgur.com/9JsSt23.png)\n\nThe contribution graph mimics the GitHub one. You can implement the `TEAContributionGraphDataSource` protocol to provide data and customize the style of the graph.\nThe required methods are:\n```objective-c\n// The DataSource should return an NSDate that occurs inside the month to graph\n- (NSDate *)monthForGraph;\n\n// The day variable is an integer from 1 to the last day of the month given by monthForGraph\n// Return the value to graph for each calendar day or 0.\n- (NSInteger)valueForDay:(NSUInteger)day;\n```\nThere are currently three more DataSource methods to customize the coloring of the graph.\nEach grade is represented by a different color.\n```objective-c\n// Defines the number of distinct colors in the graph\n- (NSUInteger)numberOfGrades;\n\n// Defines what color should be used by each grade.\n- (UIColor *)colorForGrade:(NSUInteger)grade;\n\n// Defines the cutoff values used for translating values into grades.\n// For example, you may want different grades for the values grade == 0, 1 \u003c= grade \u003c 5, 5 \u003c= grade.\n// This means there are three grades total\n// The minimumValue for the first grade is 0, the minimum for the second grade is 1, and the minimum for the third grade is 5\n- (NSInteger)minimumValueForGrade:(NSUInteger)grade;\n```\n\nThere’s also a method to define the tap behavior on contribution graph cells:\n```objective-c\n- (void)dateTapped:(NSDictionary *)dict;\n```\n\nHere is a simple sample of implementing the delegate methods after connecting `delegate` in Interface Builder.\n```objective-c\n#pragma mark - TEAContributionGraphDataSource Methods\n\n- (void)dateTapped:(NSDictionary *)dict\n{\n    NSLog(@\"date: %@ -- value: %@\", dict[@\"date\"], dict[@\"value\"]);\n}\n\n- (NSDate *)monthForGraph\n{\n\t// Graph the current month\n    return [NSDate date];\n}\n\n- (NSInteger)valueForDay:(NSUInteger)day\n{\n\t// Return 0-5\n    return day % 6;\n}\n```\n\n### Clock Chart\n\n![Clock Chart](http://i.imgur.com/dbk0a5f.png)\n\n```objective-c\n// This sample uses Storyboard\n@property (weak, nonatomic) IBOutlet TEAClockChart *clockChart;\n\nself.clockChart.data = @[\n    [TEATimeRange timeRangeWithStart:[NSDate date] end:[NSDate dateWithTimeIntervalSinceNow:3600]],\n    // ...\n];\n```\n\n### Bar Chart\n\n![Bar Chart](http://i.imgur.com/ScJksKh.png)\n\nJust a bar chart, no interaction, no animation.\n\n```objective-c\n#import \"TEAChart.h\"\n\nTEABarChart *barChart = [[TEABarChart alloc] initWithFrame:CGRectMake(20, 20, 100, 40)];\nbarChart.data = @[@2, @7, @1, @8, @2, @8];\n[self.view addSubview:barChart];\n```\n\n![Colored Bar Chart](http://i.imgur.com/evxPmxb.jpg)\n\nTo add colors to the bar chart, add an array of colors\n\n```objective-c\n#import \"TEAChart.h\"\n\nTEABarChart *barChart = [[TEABarChart alloc] initWithFrame:CGRectMake(20, 20, 100, 40)];\nbarChart.barColors = @[[UIColor orangeColor], [UIColor yellowColor], [UIColor greenColor], [UIColor blueColor]];\nbarChart.data = @[@2, @7, @1, @8, @2, @8];\n[self.view addSubview:barChart];\n```\n\nTo add x-labels to the bar chart, set ``xLabels`` property. Should be just one character per label since the bars are narrow.\n\n```objective-c\nbarChart.xLabels = @[@\"A\", @\"B\", @\"C\", @\"D\", @\"E\", @\"F\"];\n```\n\n## Installation\n\nUse CocoaPods:\n\n```ruby\npod 'TEAChart', '~\u003e 1.0'\n```\n\nOr drag **TEAChart** folder into your project.\n\n## Contribution\n\nPull requests are welcome! If you want to do something big, please open an issue first.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxhacker%2FTEAChart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxhacker%2FTEAChart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxhacker%2FTEAChart/lists"}