高度自定義圖表庫HLChartView
chart gif GitHub地址HLChartView
cocoa pods 使用
pod 'HLChartView'
1.折線圖或曲線圖 HLLineChartView
/** y軸值,必傳 */
@property(nonatomic,strong) NSArray*yValueLabels;
/** x軸座標,必傳 */
@property(nonatomic,strong) NSArray*xLabels
如何使用
HLLineChartView *lineChartView = [[HLLineChartView alloc]initWithFrame:CGRectMake(0, 100, kScreen_Width, 300)];
NSArray *arr1 = @[@"3",@"4.3",@"10.2",@"5",@"15",@"3",@"4.3",@"10.2",@"5",@"1"];
NSArray *arr2 = @[@"2",@"6.3",@"6.2",@"15",@"10",@"2",@"14.3",@"5.2",@"11",@"4"];
HLLineChartData *data1 = [HLLineChartData lineChartDataWithValuesArray:arr1 lineColor:[UIColor redColor]];
data1.yValuesColor = [UIColor greenColor];
data1.lineWidth = 3.0f;
data1.circleSize = 5;
data1.circleType = HLLineDataCircleTypeCircle;
HLLineChartData *data2 = [HLLineChartData lineChartDataWithValuesArray:arr2 lineColor:[UIColor blueColor]];
lineChartView.yValueLabels = @[data1,data2];
lineChartView.xLabels = @[@"中通快遞123",@"圓通快遞1",@"順豐快遞1222222222222222222222222",@"郵政快遞2111",@"韻達快遞22222",@"中通快遞11111",@"圓通快遞",@"順豐快遞",@"郵政快遞",@"韻達快遞"];
[self.view addSubview:lineChartView];
lineChartView.yLablesColor = [UIColor greenColor];
lineChartView.xLabelsColor = [UIColor blueColor];
// lineChartView.lineChartType = HLLineChartTypeBrokenLine;
lineChartView.ySepLabelCount = 10;
// lineChartView.xLabelsWidth = 30;
// lineChartView.xLabelsHeight = 20;
// lineChartView.lineColor = [UIColor brownColor];
// lineChartView.isHideYLabels = YES;
// lineChartView.isHideXLables = YES;
lineChartView.isShowGradientColor = NO;
// lineChartView.isShowXSepratorLine = NO;
// lineChartView.isShowYSepratorLine = NO;
// lineChartView.isAnimatedDisplay = NO;
[lineChartView strokeStart];
2.餅圖HLPieChartView
如何使用
HLPieChartData *data1 = [HLPieChartData pieDataWithValue:@"20" pieChartColor:[UIColor redColor] detailText:@"中通快遞"];
HLPieChartData *data2 = [HLPieChartData pieDataWithValue:@"10.2" pieChartColor:[UIColor blueColor] detailText:@"韻達快遞"];
HLPieChartData *data3 = [HLPieChartData pieDataWithValue:@"30.33" pieChartColor:[UIColor purpleColor] detailText:@"圓通快遞"];
HLPieChartData *data4 = [HLPieChartData pieDataWithValue:@"5" pieChartColor:[UIColor greenColor] detailText:@"順豐快遞"];
HLPieChartData *data5 = [HLPieChartData pieDataWithValue:@"8" pieChartColor:[UIColor cyanColor] detailText:@"郵政快遞"];
HLPieChartView *pieChart = [[HLPieChartView alloc]initWithFrame:CGRectMake(0, 64, kScreen_Width, kScreen_Width)];
pieChart.pieDatas = @[data1,data2,data3,data4,data5];
pieChart.outerCircleRadius = 120;
pieChart.interCircleRadius = 40;
// pieChart.isAnimatedDisplay = NO;
pieChart.lengendPosition = HLPieLengendPositionBottom;
// pieChart.pieDetailTextType = HLPieDetailTextTypeValue;
// pieChart.showLengendView = NO;
pieChart.titleText = @"這是今天收到的快遞";
[pieChart strokeStart];
[self.view addSubview:pieChart];
3.可自定義單級多級柱狀圖
如何使用
HLHistogramData *data1 = [HLHistogramData histogramDataWithValue:@"100" histogramColor:[UIColor redColor]];
HLHistogramData *data2 = [HLHistogramData histogramDataWithValue:@"30" histogramColor:[UIColor blueColor]];
HLHistogramData *data3 = [HLHistogramData histogramDataWithValue:@"50" histogramColor:[UIColor greenColor]];
HLHistogramData *data4 = [HLHistogramData histogramDataWithValue:@"120" histogramColor:[UIColor purpleColor]];
HLHistogramData *data11 = [HLHistogramData histogramDataWithValue:@"80" histogramColor:[UIColor redColor]];
HLHistogramData *data22 = [HLHistogramData histogramDataWithValue:@"20" histogramColor:[UIColor blueColor]];
HLHistogramData *data33 = [HLHistogramData histogramDataWithValue:@"165" histogramColor:[UIColor greenColor]];
HLHistogramData *data44 = [HLHistogramData histogramDataWithValue:@"60" histogramColor:[UIColor purpleColor]];
HLHistogramView *histogramView = [[HLHistogramView alloc]initWithFrame:CGRectMake(0, 100, kScreen_Width, 300)];
histogramView.yValueLabels = @[@[data1,data2,data3],@[data1,data2,data3,data4],@[data11,data22],@[data33,data44],@[data11,data22,data33,data44],@[data1,data2,data33,data44]];
histogramView.xLabels = @[@"1月底層、架構、音視訊、逆向",@"2月底視訊逆向",@"3月底層、音視訊、逆向",@"4月底層、音視訊、逆向",@"5月底層、架構、音視訊、逆向",@"6月底層"];
histogramView.xHistogramMinGap = 0;
// histogramView.xHistogramMaxGap = 40;
// histogramView.histogramWidth = 30;
// histogramView.ySepLabelCount = 6;
// histogramView.yLabelWidth = 50;
[histogramView strokeStart];
[self.view addSubview:histogramView];
使用問題,請賜教,萬分感謝
相關文章
- 高度自定義的STDPickerViewView
- SVG 菜鳥的 Recharts 自定義圖表實戰SVGEcharts
- c#WinFrom自定義圖表儀表控制元件-頻譜C#控制元件
- Flink 自定義維表
- Android圖解建立外部lib庫及自定義ViewAndroid圖解View
- elementUI 2.0.11自定義表頭UI
- elementUI table 自定義表頭UI
- dcat-admin如何自定義donut圖表的formatter閉包ORM
- Laravel 自定義表單驗證-自定義驗證規則Laravel
- Layui 自定義表單驗證UI
- Android 通知欄顯示自定義通知時設定更高的高度Android
- Vue富文字帶圖片修改圖片大小自定義選擇項自定義字型Vue自定義字型
- 6.自定義圖片剪下
- uniapp自定義卡片輪播圖APP
- AUTOCAD——新增自定義填充圖案
- Spring Boot - 自定義 Banner 圖案Spring Boot
- Win10如何自定義硬碟圖示_win10自定義硬碟圖示的教程Win10硬碟
- SharePoint Online 自定義Modern UI表單UI
- 小程式自定義表單校驗
- AngularJS自定義表單控制元件AngularJS控制元件
- java 自定義表單設計方案Java
- 自定義註解完成資料庫切庫資料庫
- 自定義上傳圖片拼圖遊戲遊戲
- 永宏BI 自定義繪圖(環狀圖)繪圖
- Flutter 112: 圖解自定義 ACEPieWidget 餅狀圖Flutter圖解
- Rust引用自定義c/c++庫RustC++
- 自定義ItemDecoration分割線的高度、顏色、偏移,看完這個你就懂了
- 自定義百度地圖元件地圖元件
- WebView自定義長按圖片功能WebView
- 位元組跳動出大招!IconPark圖示庫,自定義圖示,好用到停不下來!
- Laravel-admin 自定義匯出表單Laravel
- 表單驗證自定義格式輸出
- 使用 voyager 如何自定義,使用者表
- 易優cms模板在哪自定義表單
- 封裝 Laravel 自定義表單請求封裝Laravel
- 皕傑報表之自定義函式函式
- DcatAdmin 擴充套件: 自定義表單(動態表單)套件
- iOS自定義控制元件:自定義TableView、CollectionView空資料佔點陣圖iOS控制元件View
- iOS 一個可高度自定義化的評分控制元件、打分、打星iOS控制元件