Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/naoty/ntchartview
An easily charting library for iOS
https://github.com/naoty/ntchartview
Last synced: about 1 month ago
JSON representation
An easily charting library for iOS
- Host: GitHub
- URL: https://github.com/naoty/ntchartview
- Owner: naoty
- License: mit
- Created: 2013-07-30T17:53:27.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-08-11T04:57:52.000Z (over 11 years ago)
- Last Synced: 2024-10-22T14:02:15.857Z (3 months ago)
- Language: Objective-C
- Size: 188 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NTChartView
NTChartView is an easily charting library for iOS.
## Requirements
- iOS 5.0 or later
- Xcode 4.4 or later## Usage
### Line chart
```objc
- (void)viewDidLoad
{
NTLineChartView *lineChartView = [[NTLineChartView alloc] initWithFrame:self.view.bounds];
lineChartView.dataSource = self;
[self.view addSubview:lineChartView];
}- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
[self.lineChartView refreshWithFrame:self.view.bounds];
}#pragma mark - NTLineChartViewDataSource
- (NSInteger)numberOfLinesInLineChartView:(NTLineChartView *)lineChartView
{
return 2;
}- (NSArray *)lineChartView:(NTLineChartView *)lineChartView dataForLineAtIndex(NSInteger)index
{
if (index == 0) {
return @[@[@1, @20], @[@2, @10], @[@3, @50], @[@4, @80]];
} else {
return @[@[@1, @50], @[@2, @60], @[@3, @30], @[@4, @40]];
}
}
```