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
kevinzhow
2015-03-03 17:46:16 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c330cf08cc9f2229efb99f3f680b4df39b12fc7f
c330cf08
1 parent
e200b9ba
Revert "Merge pull request #170 from sanandrea/master"
This reverts commit
e200b9ba
, reversing changes made to
4da58d16
.
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
40 deletions
README.md
README.md
View file @
c330cf0
...
...
@@ -64,6 +64,7 @@ data02.getData = ^(NSUInteger index) {
lineChart.chartData = @[data01, data02];
[lineChart strokeChart];
```
[

](https://dl.dropboxusercontent.com/u/1599662/bar.png)
...
...
@@ -149,46 +150,6 @@ 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