A simple chart lib used for iOS(Objective-c). :-) Swift
- ARC
- iOS>=8.0
- iPhone || iPad
- Xcode 8.0 or later
- BrokenLineChart
- PieChart
- ProgressChart
- BarGraph
- RadarMap
Continuously updating ...…
At present
- by cloning the project into your repository
#import "EasyCharts.h"
The following describes the basic use of several graphs.
BrokenLineChart now includes :BrokenLineTypeCenterPoint
and BrokenLineTypeNormal
。
BrokenLineTypeNormal
Is an ordinary broken line chartBrokenLineTypeCenterPoint
made the selected point always centered
Besides BrokenLineType
,There are two more parameters when creating an object,one is frame, the other is object ECBrokenLineConfig
,parameters below:
You can use
ECBrokenLineConfig
to configure the attributes of the brokenLine charts,Each attribute is set to default values.Of course you can usenil
.
@property (nonatomic, strong) UIColor *brokenLineColor;
@property (nonatomic, strong) UIColor *backVeiwLineColor;
@property (nonatomic, strong) UIColor *backVeiwTextColor;
@property (nonatomic, strong) UIColor *backVeiwBackGroupColor;
@property (nonatomic, strong) UIColor *brokenAbscissaColor;
@property (nonatomic, assign) CGFloat minValue; //default 0
@property (nonatomic, assign) CGFloat maxValue; //default 100
@property (nonatomic, assign) CGFloat numberOfIntervalLines; //default 5
@property (nonatomic, assign) BrokenLineType brokenLineType;
Delegate is called when the point on the line is clicked.
- (void)brokenLineView:(ECBrokenLineView *)brokenLineView
selectedAtIndexPath:(NSIndexPath *)indexPath;
Initialization:
ECBrokenLineView *brokenLineView = [ECBrokenLineView lineViewWithFrame:frame
withBrokenLineConfig:nil
brokenLineType:BrokenLineTypeNormal];
brokenLineView.delegate = self;
[self.view addSubview:brokenLineView];
ECBrokenLineView *brokenLineView = [ECBrokenLineView lineViewWithFrame:frame
withBrokenLineConfig:nil
brokenLineType:BrokenLineTypeCenterPoint];
brokenLineView.delegate = self;
[self.view addSubview:brokenLineView];
Data filling: ( If the value is less than the minimum value, the minimum value is displayed。If the value is greater than the maximum value, the maximum value is displayed;point on both sides filled with dashed lines)
[self.brokenLineView reloadLineViewDataWithPointValveList:self.pointValveList
titleText:self.pointTextList];
The effect of BrokenLineTypeNormal | The effect of BrokenLineTypeCenterPoint |
---|---|
![]() |
![]() |
Initialization--Just transfer frame
.
ECProgressChartView *progressView = [ECProgressChartView progressChartViewWithFrame:frame];
[self.view addSubview:progressView];
Data filling:
[self.progressView resetProgress:[self createProgress]];
The effect of ProgressView:
Application scene:
Initialization--Just transfer frame
.
ECPieChartView *pieView = [ECPieChartView pieChartViewWithFrame:CGRectMake(0, 100, ECScreenW, 200)];
[self.view addSubview:pieView];
Data filling:Three parameters:percentList、colorList、arcTextList]
[pieView drawPieChartWithPercentList:self.percentList
colorList:self.colorList
arcTextList:self.arcTextList];
The effect of PieChart:
Initialization--Just transfer frame
.
ECRadarChartView *rView = [ECRadarChartView radarChartViewWithFrame:CGRectMake(60, 350, 270, 270)];
[self.view addSubview:rView];
Data filling:
ECRadarChartConfig *config = [[ECRadarChartConfig alloc] init];
config.backgroupLineNum = 5;
config.radius = 100;
config.drawPointArray = @[@[@(0.5),@(0.4),@(0.5),@(0.1),@(0.9)],
@[@(0.4),@(0.5),@(0.2),@(0.8),@(0.1)],
@[@(0.4),@(0.1),@(0.8),@(0.7),@(0.2)]];
config.drawLineColorArray = @[[UIColor orangeColor],[UIColor greenColor],[UIColor redColor]];
config.drawLineTitleArray = @[@"Technology",@"Execution",@"Thinking",@"Endurance",@"Speed"];
[rView setupRadarChartConfig:config];
ECRadarChartConfig *config = [[ECRadarChartConfig alloc] init];
config.backgroupLineNum = 5;
config.radius = 100;
config.drawPointArray = @[@[@(0.5),@(0.4),@(0.5),@(0.1),@(0.9),@(0.4)]];
config.drawLineColorArray = @[[UIColor orangeColor]];
config.drawLineTitleArray = @[@"Technology",@"Execution",@"Thinking",@"Endurance",@"Speed",@"Power",];
[rView setupRadarChartConfig:config];
The effect of PieChart:
- If you found a bug, and can provide steps to reliably reproduce it, open an issue.
- If you have a feature request, open an issue.
- If you want to contribute, submit a pull request.