Toggle navigation
Toggle navigation
This project
Loading...
Sign in
iOS
/
PNChart
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
andi
2015-03-03 10:23:03 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
22e9eb789963255cee9827d69cb351352336c908
22e9eb78
1 parent
b6893533
Update readme with example for legend
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
1 deletions
README.md
README.md
View file @
22e9eb7
...
...
@@ -64,7 +64,6 @@ data02.getData = ^(NSUInteger index) {
lineChart.chartData = @[data01, data02];
[lineChart strokeChart];
```
[

](https://dl.dropboxusercontent.com/u/1599662/bar.png)
...
...
@@ -150,6 +149,46 @@ CGPoint end = CGPointMake(80, 45);
scatterChart.delegate = self;
```
#### Legend
Legend has been added to PNChart for Line and Pie Charts. Legend items position can be stacked or in series.
[](https://dl.dropboxusercontent.com/u/4904447/pnchart_legend_1.png)
[](https://dl.dropboxusercontent.com/u/4904447/pnchart_legend_2.png)
```
objective-c
#import "PNChart.h"
//For Line Chart
//Add Line Titles for the Legend
data01.dataTitle = @"Alpha";
data02.dataTitle = @"Beta Beta Beta Beta";
//Build the legend
self.lineChart.legendStyle = PNLegendItemStyleSerial;
self.lineChart.legendFontSize = 12.0;
UIView
*
legend =
[
self.lineChart getLegendWithMaxWidth:320
]
;
//Move legend to the desired position and add to view
[
legend setFrame:CGRectMake(100, 400, legend.frame.size.width, legend.frame.size.height)
]
;
[
self.view addSubview:legend
]
;
//For Pie Chart
//Build the legend
self.pieChart.legendStyle = PNLegendItemStyleStacked;
self.pieChart.legendFontSize = 12.0;
UIView
*
legend =
[
self.pieChart getLegendWithMaxWidth:200
]
;
//Move legend to the desired position and add to view
[
legend setFrame:CGRectMake(130, 350, legend.frame.size.width, legend.frame.size.height)
]
;
[
self.view addSubview:legend
]
;
```
#### Update Value
Now it's easy to update value in real time
...
...
Please
register
or
login
to post a comment