AAChartKit a very beautiful iOS open source graphics library

AAChartKit

AAChartKit project is based on the popular open source front-end chart library Highcharts, the package of object-oriented, a set of simple and easy to use, extremely beautiful graphics rendering controls
  1. Adaptation iOS 7, support ARC, support OC language, simple configuration
  2. Powerful, support bar graph bar graph line chart, radar chart, fan chart, bubble chart, etc.
  3. The animation is exquisite, smooth and beautiful
  4. Support Masonry programming syntax
  5. AAChartView + AAChartModel = Chart, in the AAChartKit library, follow such a minimalist formula: = + control chart view chart model you want to chart. Dear, if you feel satisfied, when used for a star, your encouragement will be my great power after a continued effort. Transfer
    https://github.com/AAChartModel/AAChartKit

Usage method

Dead work

  1. Drag the folder AAChartKitFiles in project demo into the desired project
  2. Add #import ‘AAGlobalMacro.h’ to your project’s.Pch global macro definition file”

Officially started

1 add in your view controller file

#import "AAChartView.h"

2 create view AAChartView

AAChartView *chartView = [[AAChartView alloc]init]; self.view.backgroundColor [UIColor = whiteColor]; chartView.frame = CGRectMake (0, 60, self.view.frame.size.width, self.view.frame.size.height-220); chartView.contentHeight = self.view.frame.size.height-220; / / set the chart view height (default contentHeight and AAChartView of the same height) [self.view addSubview:chartView];

3 configuration view model AAChartModel

AAChartModel *chartModel= AAObject(AAChartModel) .chartTypeSet(AAChartTypeColumn)//设置图表的类型(这里以设置的为柱状图为例) .titleSet(@"编程语言热度")//设置图表标题 .subtitleSet(@"虚拟数据")//设置图表副标题 .categoriesSet(@[@"Java",@"Swift",@"Python",@"Ruby", @"PHP",@"Go",@"C",@"C#",@"C++"])//设置图表横轴的内容 .yAxisTitleSet(@"摄氏度")//设置图表 y 轴的单位 .seriesSet(@[ AAObject(AASeriesElement) .nameSet(@"2017") .dataSet(@[@45,@56,@34,@43,@65,@56,@47,@28,@49]),  AAObject(AASeriesElement) .nameSet(@"2018") .dataSet(@[@11,@12,@13,@14,@15,@16,@17,@18,@19]),  AAObject(AASeriesElement) .nameSet(@"2019") .dataSet(@[@31,@22,@33,@54,@35,@36,@27,@38,@39]),  AAObject(AASeriesElement) .n AmeSet (@ 2020).DataSet (@[@21, @22, @53, @24, @65, @26, @37, @28, @49]),];

4 draw graphics

[chartView aa_drawChartWithChartModel:chartModel]; / / chart view object call graph model object, rendering the final graphics

5 special instructions

AAChartKit fan chart, bubble map are attributed to a special type, so you want to draw fan, bubble chart, graphic model AAChartModel settings slightly different, the example is as follows

  • Drawpie map, you need AAChartModel *chartModel= AAObject configuration model AAChartModel (AAChartModel).ChartTypeSet (AAChartTypePie).TitleSet (@ “programming language heat” (@.SubtitleSet) “virtual data”).DataLabelEnabledSet (true) / / if directly display the pie chart data.YAxisTitleSet (@ C).SeriesSet (@[AAObject (AASeriesElement).NameSet (@ “language heat rate” (.DataSet) @[@[@ “Java”, “Swift” @67], @[@, @44], @[@ “Python”, “OC” @83], @[@, @11], @[@ “Ruby”, “PHP @42], @[@” @[@, @31], “Go”, “C” @63], @[@, @24], @[@ “C#”, “C++” @888], @[@, @66])]]);
  • To draw bubble diagrams, you need to configure the model AAChartModel
AAChartModel *chartModel= AAObject (AAChartModel).ChartTypeSet (AAChartTypeBubble).TitleSet (@ "programming language heat" (@.SubtitleSet) "virtual data (".YAxisTitleSet ") @ C (.SeriesSet) @[AAObject (AASeriesElement).NameSet (@ 2017).DataSet (@[@[@97, @36, @79], @[@94, @74, @60]. @[@68, @76, @58], @[@64, @87, @56], @[@68, @27, @73], @[@74, @99, @42], @[@7, @93, @87], @[@51, @69, @40], @[@38, @23, @33], @[@57, @86, @31]]), AAObject (AASeriesElement).NameSet (@ 2018).DataSet (@[@[@25, @10, @87], @[@2, @75, @59], @[@11, @54, @8], @[@86, @55, @93], @[@5, @3, @58]. @[@90, @63, @44], @[@91, @33, @17], @[@97, @3, @56], @[@15, @67, @48], @[@54, @25, @81]]), AAObject (AASeriesElement).NameSet (@ 2019).DataSet (@[@[@47, @47, @21], @[@20, @12, @4], @[@6, @76, @91], @[@38, @30, @60], @[@57, @98, @64], @[@61, @17, @80]. @[@83, @60, @13], @[@67, @78, @75], @[@64, @12, @10], @[ @30, @77, @82]]];

Some of the important properties of the AAChartModel after the configuration of the graphic example is as follows

  • Conventional line chart
AAChartKit a very beautiful iOS open source graphics library
IMG_1867.JPG
  • Conventional column chart
AAChartKit a very beautiful iOS open source graphics library
IMG_1873.JPG
  • Y axis flip accumulation curve filling graph
AAChartKit a very beautiful iOS open source graphics library
IMG_1871.JPG
  • X axis flip accumulation curve filling graph
AAChartKit a very beautiful iOS open source graphics library
IMG_1869.JPG
  • X axis of the percentage of the cumulative curve to fill the map
AAChartKit a very beautiful iOS open source graphics library
IMG_1863.JPG
  • Stacked line filling
AAChartKit a very beautiful iOS open source graphics library
IMG_1870.JPG
  • Radiation percentage stacked line filling
AAChartKit a very beautiful iOS open source graphics library
IMG_1868.JPG
  • The percentage of the head is oval
AAChartKit a very beautiful iOS open source graphics library
IMG_1866.JPG
  • A percentage of the head of the wedge bar
AAChartKit a very beautiful iOS open source graphics library
IMG_1865.JPG

AAChartModel property configuration list

AAPropStatementAndFuncStatement (copy, AAChartModel, NSString, title); / / AAPropStatementAndFuncStatement (copy, AAChartModel title content, NSString *, subtitle); / / AAPropStatementAndFuncStatement (copy, AAChartModel:, NSString *, chartType); / / chart type AAPropStatementAndFuncStatement (copy, AAChartModel, NSString, stacking); / / AAPropStatementAndFuncStatement (copy, packing style AAChartModel, NSString *, symbol); / / curve type: "circle", "square", "diamond", "triangle", "triangle-down", the default is "circle" AAPropStatementAndFuncStatement (copy, AAChartModel, NSString, zoomType); / / zoom type AAPropStatementAndFuncStatement (assign, AAChartModel, BOOL, inverted); the //x axis is vertical (assign, A AAPropStatementAndFuncStatement AChartModel, BOOL, xAxisReversed); / / X axis (assign, AAChartModel, flip AAPropStatementAndFuncStatement BOOL, yAxisReversed); //y AAPropStatementAndFuncStatement (assign, AAChartModel axis, BOOL, crosshairs); / / whether to show the quasi star line (by default) AAPropStatementAndFuncStatement (assign, AAChartModel, BOOL, gradientColorEnable); / / if you want to color for the gradient AAPropStatementAndFuncStatement (assign, AAChartModel, BOOL, polar); / / if the polarization pattern (into radar map) AAPropStatementAndFuncStatement (assign, AAChartModel, BOOL, dataLabelEnabled); / / if the display data AAPropStatementAndFuncStatement (assign, AAChartModel, BOOL, xAxisLabelsEnabled); the //x shaft is to display data in AAPropStatementAndFuncStatement (strong, AAChartModel, NSArray, categories); / / chart The corresponding horizontal coordinates of each point in the name of the AAPropStatementAndFuncStatement (strong, AAChartModel, NSNumber, xAxisGridLineWidth); the //x axis grid line width AAPropStatementAndFuncStatement (assign, AAChartModel, BOOL, yAxisLabelsEnabled); the //y shaft is to display data in AAPropStatementAndFuncStatement (copy, AAChartModel, NSString, yAxisTitle); //y AAPropStatementAndFuncStatement (strong, AAChartModel axis, NSNumber * yAxisGridLineWidth, //y axis); grid line width AAPropStatementAndFuncStatement (strong, AAChartModel, NSArray, colorsTheme); / / chart theme color array AAPropStatementAndFuncStatement (strong, AAChartModel, NSArray, Series); AAPropStatementAndFuncStatement (assign, AAChartModel, BOOL, legendEnabled); / / whether to display the legend of AAPropStatementAndFu NcStatement (copy, AAChartModel, NSString, legendLayout); AAPropStatementAndFuncStatement (copy, AAChartModel, NSString, legendAlign); AAPropStatementAndFuncStatement (copy, AAChartModel, NSString, legendVerticalAlign); AAPropStatementAndFuncStatement (copy, AAChartModel, NSString, backgroundColor); / / chart background color AAPropStatementAndFuncStatement (assign, AAChartModel, BOOL, options3dEnable); / / whether the 3D graphic (only on the bar chart, AAPropStatementAndFuncStatement histogram effective) (strong, AAChartModel, NSNumber, options3dAlpha); AAPropStatementAndFuncStatement (strong, AAChartModel, NSNumber, options3dBeta); AAPropStatementAndFuncStatement (strong, AAChartModel, NSNumber, options3dDepth); //3D graphics depth AAPropStatementAndFu NcStatement (strong, AAChartModel, NSNumber, borderRadius); / / head radius (histogram histogram can be used to set the shape of the head) AAPropStatementAndFuncStatement (strong, AAChartModel, NSNumber, markerRadius); / / the length of radius line connecting points

More graphic effects

AAChartKit a very beautiful iOS open source graphics library
AAChartKit function demo.Gif