The first offering this control web site, https://github.com/kevinzhow/PNChart;

One of the company’s recent projects has used native bar charts, but the self-packaged charts have been jammed in the face of a large amount of data, which is not smooth enough for a Virgo iOS programmer. Simply searching on the Internet, I can find two good icon frames, Charts and PNChart. The former is suitable for Swift(of course, it can also bridge it to OC, but I feel this method is very useless). The latter has Swift and OC versions. Of course, choose the latter. For details, please refer to the instructions on Github. For details, please refer to the instructions on Github. For details, please refer to github. Compile… Error: #import” pnradarChartDataitem. h” error: #import” pnradarChartDataitem. h” error: #import” pnradarChartDataitem. h” First, log on github, the world’s largest gay dating website, search for UICountingLabel, extract it, drag the.m and.h files of UICountingLabel into the project and then The error of the # import < UICountingLabel/UICountingLabel. H > header file change to # import “UICountingLabel. H” compile again, no problem at all. To get started: The first step is to introduce headers, of course, by introducing #import” pnchart.h “where diagrams are needed and then referring to the official demo

Self. barChart = [[PNBarChart alloc] initWithFrame:CGRectMake(0, 135.0, SCREEN_WIDTH, 200.0)]; // self.barChart.showLabel = NO; self.barChart.yLabelFormatter = ^(CGFloat yValue) {return[barChartFormatter stringFromNumber:@(yValue)]; }; The self. The barChart. YChartLabelWidth = 20.0; The self. The barChart. ChartMarginLeft = 30.0; The self. The barChart. ChartMarginRight = 10.0; The self. The barChart. ChartMarginTop = 5.0; The self. The barChart. ChartMarginBottom = 10.0; The self. The barChart. LabelMarginTop = 5.0; self.barChart.showChartBorder = YES; [self.barChartsetXLabels:@[@"2"The @"3"The @"4"The @"5"The @"2"The @"3"The @"4"The @"5"]];
//       self.barChart.yLabels = @[@-10,@0,@10];
//        [self.barChart setYValues: @ @ 10000.0, @ 30000.0, @ 10000.0, @ 100000.0, @ 500000.0, @ 1000000.0, @ 1150000.0, @ 2150000.0]]. [self.barChartsetYValues: @ @ 10.82, @ 1.88, @ 6.96, @ 33.93, @ 10.82, @ 1.88, @ 6.96, @ 33.93]]. [self.barChartsetStrokeColors:@[PNGreen, PNGreen, PNRed, PNGreen, PNGreen, PNGreen, PNRed, PNGreen]];
        self.barChart.isGradientShow = NO;
        self.barChart.isShowNumbers = NO;
        [self.barChart strokeChart];
        self.barChart.delegate = self;
        [self.view addSubview:self.barChart];
Copy the code

But what happens when you run it out and find the X coordinate? Where is the X coordinate data looked found is the demo of the self. The barChart. LabelMarginTop = 5.0; Problem, you can modify.

Then the control is formally packaged into the project however

self.barChart.yLabelSum
self.barChart.xLabelSkip