Showing
1 changed file
with
7 additions
and
7 deletions
| @@ -40,7 +40,7 @@ You will need LLVM 3.0 or later in order to build PNChart. | @@ -40,7 +40,7 @@ You will need LLVM 3.0 or later in order to build PNChart. | ||
| 40 | //For LineChart | 40 | //For LineChart |
| 41 | PNLineChart * lineChart = [[PNLineChart alloc] initWithFrame:CGRectMake(0, 135.0, SCREEN_WIDTH, 200.0)]; | 41 | PNLineChart * lineChart = [[PNLineChart alloc] initWithFrame:CGRectMake(0, 135.0, SCREEN_WIDTH, 200.0)]; |
| 42 | [lineChart setXLabels:@[@"SEP 1",@"SEP 2",@"SEP 3",@"SEP 4",@"SEP 5"]]; | 42 | [lineChart setXLabels:@[@"SEP 1",@"SEP 2",@"SEP 3",@"SEP 4",@"SEP 5"]]; |
| 43 | - | 43 | + |
| 44 | // Line Chart Nr.1 | 44 | // Line Chart Nr.1 |
| 45 | PNLineChartData *data01 = [PNLineChartData new]; | 45 | PNLineChartData *data01 = [PNLineChartData new]; |
| 46 | data01.color = [UIColor redColor]; | 46 | data01.color = [UIColor redColor]; |
| @@ -49,7 +49,7 @@ You will need LLVM 3.0 or later in order to build PNChart. | @@ -49,7 +49,7 @@ You will need LLVM 3.0 or later in order to build PNChart. | ||
| 49 | CGFloat y = item * 10; | 49 | CGFloat y = item * 10; |
| 50 | return [PNLineChartDataItem dataItemWithY:y]; | 50 | return [PNLineChartDataItem dataItemWithY:y]; |
| 51 | }; | 51 | }; |
| 52 | - | 52 | + |
| 53 | // Line Chart Nr.2 | 53 | // Line Chart Nr.2 |
| 54 | PNLineChartData *data02 = [PNLineChartData new]; | 54 | PNLineChartData *data02 = [PNLineChartData new]; |
| 55 | data02.color = [UIColor blueColor]; | 55 | data02.color = [UIColor blueColor]; |
| @@ -58,7 +58,7 @@ You will need LLVM 3.0 or later in order to build PNChart. | @@ -58,7 +58,7 @@ You will need LLVM 3.0 or later in order to build PNChart. | ||
| 58 | CGFloat y = item == 0 ? (item * 5) + 10 : (item * 5); | 58 | CGFloat y = item == 0 ? (item * 5) + 10 : (item * 5); |
| 59 | return [PNLineChartDataItem dataItemWithY:y]; | 59 | return [PNLineChartDataItem dataItemWithY:y]; |
| 60 | }; | 60 | }; |
| 61 | - | 61 | + |
| 62 | lineChart.chartData = @[data01, data02]; | 62 | lineChart.chartData = @[data01, data02]; |
| 63 | [lineChart strokeChart]; | 63 | [lineChart strokeChart]; |
| 64 | 64 | ||
| @@ -111,12 +111,12 @@ lineChart.delegate = self; | @@ -111,12 +111,12 @@ lineChart.delegate = self; | ||
| 111 | //For DelegateMethod | 111 | //For DelegateMethod |
| 112 | 112 | ||
| 113 | 113 | ||
| 114 | --(void)userClickedOnLineKeyPoint:(CGPoint)point andPointIndex:(NSInteger)index{ | 114 | +-(void)userClickedOnLineKeyPoint:(CGPoint)point lineIndex:(NSInteger)lineIndex andPointIndex:(NSInteger)pointIndex{ |
| 115 | - NSLog(@"Click Key on line %f, %f and index is %d",point.x, point.y,index); | 115 | + NSLog(@"Click Key on line %f, %f line index is %d and point index is %d",point.x, point.y,(int)lineIndex, (int)pointIndex); |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | --(void)userClickedOnLinePoint:(CGPoint)point { | 118 | +-(void)userClickedOnLinePoint:(CGPoint)point lineIndex:(NSInteger)lineIndex{ |
| 119 | - NSLog(@"Click on line %f, %f",point.x, point.y); | 119 | + NSLog(@"Click on line %f, %f, line index is %d",point.x, point.y, (int)lineIndex); |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | ``` | 122 | ``` |
-
Please register or login to post a comment