You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
100 lines
2.9 KiB
100 lines
2.9 KiB
![]()
2 years ago
|
# ORCharts
|
||
|
|
||
|
[](https://travis-ci.org/sunrise_oy@163.com/ORCharts)
|
||
|
[](https://cocoapods.org/pods/ORCharts)
|
||
|
[](https://cocoapods.org/pods/ORCharts)
|
||
|
[](https://cocoapods.org/pods/ORCharts)
|
||
|
|
||
|
## Table of contents
|
||
|
* [Screenshots](#screenshots)
|
||
|
* [Installation](#installation)
|
||
|
* [Setup](#setup)
|
||
|
|
||
|
# <a id="screenshots"></a>Screenshots
|
||
|
|
||
|
### RingChart
|
||
|

|
||
|
|
||
|
### LineChart
|
||
|
| Slider | Control |
|
||
|
|--------------|-------------|
|
||
|
|||
|
||
|
|
||
|
|
||
|
### Example Config
|
||
|
|
||
|
To run the example project.
|
||
|
|
||
|
| Ring | Line |
|
||
|
|--------------|-------------|
|
||
|
|  |  |
|
||
|
|
||
|
|
||
|
# <a id="installation"></a>Installation
|
||
|
|
||
|
### ORCharts
|
||
|
```ruby
|
||
|
pod 'ORCharts'
|
||
|
```
|
||
|
### Only Ring
|
||
|
|
||
|
```ruby
|
||
|
pod 'ORCharts/Ring'
|
||
|
```
|
||
|
### Only Line
|
||
|
|
||
|
```ruby
|
||
|
pod 'ORCharts/Line'
|
||
|
```
|
||
|
# <a id="setup"></a>Setup
|
||
|
|
||
|
## Use Interface Builder
|
||
|
1、 Drag an UIView object to ViewController Scene
|
||
|
2、 Change the `Custom Class` to `ORLineChartView` or `ORRingChartView` <br/>
|
||
|
3、 Link `dataSource` and `delegate` to the ViewController <br/>
|
||
|
|
||
|
## Or use code
|
||
|
|
||
|
```objc
|
||
|
@property (nonatomic, strong) ORRingChartView *ringChartView;
|
||
|
```
|
||
|
```objc
|
||
|
_ringChartView = [[ORRingChartView alloc] initWithFrame:CGRectMake(0, 0, 375, 375)];
|
||
|
_ringChartView.dataSource = self;
|
||
|
[self.view addSubview:_ringChartView];
|
||
|
```
|
||
|
<br/>
|
||
|
```objc
|
||
|
@property (nonatomic, strong) ORLineChartView *lineChartView;
|
||
|
```
|
||
|
```objc
|
||
|
_lineChartView = [[ORLineChartView alloc] initWithFrame:CGRectMake(0, 0, 375, 350)];
|
||
|
_lineChartView.dataSource = self;
|
||
|
_lineChartView.delegate = self;
|
||
|
[self.view addSubview:_lineChartView];
|
||
|
```
|
||
|
<br/>
|
||
|
|
||
|
## reloadData
|
||
|
reloadData when data or config changed, see more usage and config in example
|
||
|
|
||
|
```objc
|
||
|
[_ringChartView reloadData];
|
||
|
```
|
||
|
```objc
|
||
|
[_lineChartView reloadData];
|
||
|
```
|
||
|
## dataSource && delegate && config
|
||
|
Refer to the Example Or Click the link below
|
||
|
|
||
|
* [ORCharts:Ring](https://www.jianshu.com/p/317a79890984)
|
||
|
* [ORCharts:Line](https://www.jianshu.com/p/a571ae110ba5)
|
||
|
|
||
|
|
||
|
|
||
|
## License
|
||
|
|
||
|
ORCharts is available under the MIT license. See the LICENSE file for more info.
|
||
|
|
||
|
### [中文简书](https://www.jianshu.com/p/6f65bf7dfbbf)
|