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
2013-12-12 08:40:56 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
eeffac773330b977e122efbe9970dae39ef32ce1
eeffac77
1 parent
538855f0
Add delegate readme
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
1 deletions
README.md
README.md
View file @
eeffac7
...
...
@@ -31,7 +31,6 @@ You will need LLVM 3.0 or later in order to build PNChart.
### Copy the PNChart folder to your project
#### Line Chart
[

](https://dl.dropboxusercontent.com/u/1599662/line.png)
...
...
@@ -76,6 +75,45 @@ You will need LLVM 3.0 or later in order to build PNChart.
```
#### Callback
```
objective-c
#import "PNChart.h"
//For LineChart
PNChart
*
lineChart =
[
[PNChart alloc
]
initWithFrame:CGRectMake(0, 135.0, SCREEN_WIDTH, 200.0)];
lineChart.backgroundColor =
[
UIColor clearColor
]
;
[
lineChart setXLabels:@[@"SEP 1",@"SEP 2",@"SEP 3",@"SEP 4",@"SEP 5",@"SEP 6",@"SEP 7"
]
];
[
lineChart setYValues:@[@1,@24,@12,@18,@30,@10,@21
]
];
[
lineChart strokeChart
]
;
lineChart.delegate = self;
[
viewController.view addSubview:lineChartLabel
]
;
[
viewController.view addSubview:lineChart
]
;
viewController.title = @"Line Chart";
```
```
objective-c
#import "PNChart.h"
//For DelegateMethod
-(void)userClickedOnLineKeyPoint:(CGPoint)point andPointIndex:(NSInteger)index{
NSLog(@"Click Key on line %f, %f and index is %d",point.x, point.y,index);
}
-(void)userClickedOnLinePoint:(CGPoint)point {
NSLog(@"Click on line %f, %f",point.x, point.y);
}
```
## License
This code is distributed under the terms and conditions of the
[
MIT license
](
LICENSE
)
.
...
...
Please
register
or
login
to post a comment