XXChartView
好用的統(tǒng)計(jì)圖,折線統(tǒng)計(jì)圖,柱狀統(tǒng)計(jì)圖
覺(jué)得好用記得在github上給點(diǎn)星星哦
https://github.com/PittWong/XXChartView
使用說(shuō)明
提供快捷創(chuàng)建方法,傳入對(duì)應(yīng)參數(shù)快速生成統(tǒng)計(jì)圖
只需傳入3個(gè)基礎(chǔ)參數(shù)
1.所有需要顯示的數(shù)值
2.所有x軸上標(biāo)題
3.y軸上需要分成幾組顯示(y軸標(biāo)題數(shù)值根據(jù)所有數(shù)值自動(dòng)計(jì)算分割顯示)
還可通過(guò)tintColor設(shè)置喜歡的顏色
核心構(gòu)造方法
- (instancetype)initWithValues:(NSArray *)values xTittles:(NSArray *)xTittles yTittleCount:(NSInteger)yTittleCount;
+ (instancetype)chartViewWithValues:(NSArray *)values xTittles:(NSArray *)xTittles yTittleCount:(NSInteger)yTittleCount;
使用事例
NSArray * values = @[@5.6,@7.8,@6,@8.5,@3,@7,@8.9];
NSArray * xTittles = @[@"標(biāo)題1",@"標(biāo)題2",@"標(biāo)題3",@"標(biāo)題4",@"標(biāo)題5",@"標(biāo)題6",@"標(biāo)題7"];
NSInteger yTittleCount = 4;
XXLineChartView *chartView = [[XXLineChartView alloc]initWithValues:values xTittles:xTittles yTittleCount:yTittleCount];
chartView.frame = CGRectInset(self.view.bounds, 0, 200);
[self.view addSubview:chartView];
折線統(tǒng)計(jì)圖,柱狀圖

6864D13F-7399-41CF-A956-4A0D2568DAEE.png