EasyCharts


项目主页    by: foolsong     Star:    Fork:     

EasyCharts

A simple chart lib used for iOS(Objective-c). :-)

中文说明

Requirements

  • ARC
  • iOS>=8.0
  • iPhone || iPad
  • Xcode 8.0 or later

Features

  • BrokenLineChart
  • PieChart
  • ProgressChart
  • BarGraph
  • RadarMap

Continuously updating ...…

Installation

At present

  • by cloning the project into your repository

Usage

Import header file

#import "EasyCharts.h"

The following describes the basic use of several graphs.

BrokenLineChart

BrokenLineChart now includes :BrokenLineTypeCenterPoint and BrokenLineTypeNormal

BrokenLineTypeNormalIs an ordinary broken line chart BrokenLineTypeCenterPointmade 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 use nil.

@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

EC_lineNormal

The effect of BrokenLineTypeCenterPoint

EC_lineCenterView

ProgressView

Initialization--Just transfer frame.

ECProgressChartView *progressView = [ECProgressChartView progressChartViewWithFrame:frame];
    [self.view addSubview:progressView];

Data filling:

[self.progressView resetProgress:[self createProgress]];

The effect of ProgressView:

EC_lineCenterView

BrokenLineChart && ProgressView

Application scene:

EC_lineCenterView

PieChart

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:

EC_lineCenterView

Communication

  • 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.

相关文章