Showing
2 changed files
with
33 additions
and
14 deletions
| 1 | #PNChart | 1 | #PNChart |
| 2 | 2 | ||
| 3 | -A simple and beautiful chart lib with animation used in [Piner](https://itunes.apple.com/us/app/piner/id637706410) for iOS | 3 | +A simple and beautiful chart lib with **animation** used in [Piner](https://itunes.apple.com/us/app/piner/id637706410) for iOS |
| 4 | - | ||
| 5 | -[](http://dl.dropboxusercontent.com/u/1599662/pnchart.png) | ||
| 6 | 4 | ||
| 7 | ## Requirements | 5 | ## Requirements |
| 8 | 6 | ||
| @@ -24,31 +22,56 @@ You will need LLVM 3.0 or later in order to build PNChart. | @@ -24,31 +22,56 @@ You will need LLVM 3.0 or later in order to build PNChart. | ||
| 24 | 22 | ||
| 25 | [CocoaPods](http://cocoapods.org) is the recommended way to add PNChart to your project. | 23 | [CocoaPods](http://cocoapods.org) is the recommended way to add PNChart to your project. |
| 26 | 24 | ||
| 27 | -1. Add a pod entry for PNChart to your Podfile `pod 'PNChart', '~> 0.1.8'` | 25 | +1. Add a pod entry for PNChart to your Podfile `pod 'PNChart', '~> 0.2.0'` |
| 28 | 2. Install the pod(s) by running `pod install`. | 26 | 2. Install the pod(s) by running `pod install`. |
| 29 | 3. Include PNChart wherever you need it with `#import "PNChart.h"`. | 27 | 3. Include PNChart wherever you need it with `#import "PNChart.h"`. |
| 30 | 28 | ||
| 31 | 29 | ||
| 32 | ### Copy the PNChart folder to your project | 30 | ### Copy the PNChart folder to your project |
| 33 | 31 | ||
| 32 | +#### Line Chart | ||
| 33 | + | ||
| 34 | +[](https://dl.dropboxusercontent.com/u/1599662/line.png) | ||
| 35 | + | ||
| 34 | ```objective-c | 36 | ```objective-c |
| 35 | #import "PNChart.h" | 37 | #import "PNChart.h" |
| 36 | 38 | ||
| 37 | //For LineChart | 39 | //For LineChart |
| 38 | - PNChart * lineChart = [[PNChart alloc] initWithFrame:CGRectMake(0, 75.0, SCREEN_WIDTH, 200.0)]; | 40 | + PNChart * lineChart = [[PNChart alloc] initWithFrame:CGRectMake(0, 135.0, SCREEN_WIDTH, 200.0)]; |
| 39 | [lineChart setXLabels:@[@"SEP 1",@"SEP 2",@"SEP 3",@"SEP 4",@"SEP 5"]]; | 41 | [lineChart setXLabels:@[@"SEP 1",@"SEP 2",@"SEP 3",@"SEP 4",@"SEP 5"]]; |
| 40 | - [lineChart setYValues:@[@"1",@"10",@"2",@"6",@"3"]]; | 42 | + [lineChart setYValues:@[@1, @10, @2, @6, @3]]; |
| 41 | [lineChart strokeChart]; | 43 | [lineChart strokeChart]; |
| 42 | 44 | ||
| 45 | +``` | ||
| 46 | + | ||
| 47 | +[](https://dl.dropboxusercontent.com/u/1599662/bar.png) | ||
| 48 | + | ||
| 49 | +```objective-c | ||
| 50 | + #import "PNChart.h" | ||
| 51 | + | ||
| 43 | //For BarChart | 52 | //For BarChart |
| 44 | - PNChart * barChart = [[PNChart alloc] initWithFrame:CGRectMake(0, 75.0, SCREEN_WIDTH, 200.0)]; | 53 | + PNChart * barChart = [[PNChart alloc] initWithFrame:CGRectMake(0, 135.0, SCREEN_WIDTH, 200.0)]; |
| 45 | barChart.type = PNBarType; | 54 | barChart.type = PNBarType; |
| 46 | [barChart setXLabels:@[@"SEP 1",@"SEP 2",@"SEP 3",@"SEP 4",@"SEP 5"]]; | 55 | [barChart setXLabels:@[@"SEP 1",@"SEP 2",@"SEP 3",@"SEP 4",@"SEP 5"]]; |
| 47 | - [barChart setYValues:@[@"1",@"10",@"2",@"6",@"3"]]; | 56 | + [barChart setYValues:@[@1, @10, @2, @6, @3]]; |
| 48 | [barChart strokeChart]; | 57 | [barChart strokeChart]; |
| 49 | 58 | ||
| 50 | - //By strokeColor you can change the chart color | 59 | +``` |
| 51 | - [barChart setStrokeColor:PNTwitterColor]; | 60 | + |
| 61 | +[](https://dl.dropboxusercontent.com/u/1599662/circle.png) | ||
| 62 | + | ||
| 63 | + | ||
| 64 | +```objective-c | ||
| 65 | + #import "PNChart.h" | ||
| 66 | + | ||
| 67 | + //For CircleChart | ||
| 68 | + | ||
| 69 | + PNChart * circleChart = [[PNChart alloc] initWithFrame:CGRectMake(0, 135.0, SCREEN_WIDTH, 200.0)]; | ||
| 70 | + circleChart.type = PNCircleType; | ||
| 71 | + circleChart.total = [NSNumber numberWithInt:100]; | ||
| 72 | + circleChart.current = [NSNumber numberWithInt:60]; | ||
| 73 | + [circleChart strokeChart]; | ||
| 74 | + | ||
| 52 | ``` | 75 | ``` |
| 53 | 76 | ||
| 54 | ## License | 77 | ## License |
-
Please register or login to post a comment