Latest | 1.1.1 |
---|---|
Homepage | https://github.com/michalkonturek/GraphKit |
License | MIT |
Platforms | ios 7.0, requires ARC |
Dependencies | FrameAccessor, MKFoundationKit/NSArray |
Authors |
A lightweight library of animated charts for iOS.
License
Source code of this project is available under the standard MIT license. Please see the license file.
Usage
To see a quick demo, simply type pod try GraphKit
.
Bar Graph
Initialize GKBarGraph
from nib or programmatically:
CGRect frame = CGRectMake(0, 40, 320, 200);
self.graphView = [[GKBarGraph alloc] initWithFrame:frame];
then set GKGraphViewDataSource
self.graphView.dataSource = self;
and call draw
method.
[self.graphView draw];
Please see example.
GKBarGraphDataSource
Protocol
@required
- (NSInteger)numberOfBars;
- (NSNumber *)valueForBarAtIndex:(NSInteger)index;
@optional
- (UIColor *)colorForBarAtIndex:(NSInteger)index;
- (UIColor *)colorForBarBackgroundAtIndex:(NSInteger)index;
- (CFTimeInterval)animationDurationForBarAtIndex:(NSInteger)index;
- (NSString *)titleForBarAtIndex:(NSInteger)index;
Line Graph
CGRect frame = CGRectMake(0, 40, 320, 200);
self.graphView = [[GKLineGraph alloc] initWithFrame:frame];
self.graph.dataSource = self;
self.graph.lineWidth = 3.0;
[self.graph draw];
Please see example.
GKLineGraphDataSource
Protocol
@required
- (NSInteger)numberOfLines;
- (UIColor *)colorForLineAtIndex:(NSInteger)index;
- (NSArray *)valuesForLineAtIndex:(NSInteger)index;
@optional
- (CFTimeInterval)animationDurationForLineAtIndex:(NSInteger)index;
- (NSString *)titleForLineAtIndex:(NSInteger)index;
Contributing
- Fork it.
- Create your feature branch (
git checkout -b new-feature
). - Commit your changes (
git commit -am 'Added new-feature'
). - Push to the branch (
git push origin new-feature
). - Create new Pull Request.
Latest podspec
{ "name": "GraphKit", "version": "1.1.1", "summary": "A lightweight library of animated charts for iOS.", "homepage": "https://github.com/michalkonturek/GraphKit", "license": "MIT", "authors": { "Michal Konturek": "[email protected]" }, "platforms": { "ios": "7.0" }, "social_media_url": "https://twitter.com/michalkonturek", "source": { "git": "https://github.com/michalkonturek/GraphKit.git", "tag": "1.1.1" }, "source_files": "Source/**/*.{h,m}", "requires_arc": true, "dependencies": { "FrameAccessor": [ "~> 1.3.2" ], "MKFoundationKit/NSArray": [ "~> 1.2.2" ] } }
Mon, 29 Feb 2016 22:50:03 +0000