@@ -99,9 +99,9 @@ - (AAOptions *)configureChartOptions {
9999 case 16 : return [self configureTheMirrorColumnChart ];// 正负对称的镜像柱状图
100100 case 17 : return [self yAxisOnTheRightSideChart ];// y轴在右侧的图表
101101 case 18 : return [self simpleGaugeChart ];// 简易仪表图
102- case 19 : return [self gaugeChartWithPlotBand ];// 带有颜色带的仪表图
103- case 20 : return [self configureAAPlotBandsForChart ];// 带有颜色标志带的曲线图表
104- case 21 : return [self configureAAPlotLinesForChart ];// 带有颜色标志线及文字的曲线图表
102+ case 19 : return [self gaugeChartWithPlotBand ];// 带有颜色标志带的仪表图
103+ case 20 : return [self configureAAPlotBandsForChart ];// 带有颜色标志带的曲线图
104+ case 21 : return [self configureAAPlotLinesForChart ];// 带有颜色标志线及文字的折线图表
105105 case 22 : return [self configureAASeriesElementZones ];// 数据分区 Zones
106106 case 23 : return [self configureAASeriesElementZonesMixedAAPlotLines ];// 数据分区 Zones 和颜色标志线混合
107107 case 24 : return [self adjustChartDataLabelsStyle ];// 自定义DataLabels样式
@@ -121,8 +121,11 @@ - (AAOptions *)configureChartOptions {
121121 case 38 : return [self customChartStyleWhenEveryDataValueIsZero ];// 所有数据都为 0 的情况下, 配置图表的 x 轴 y 轴等样式
122122 case 39 : return [self disableSpineChartHoverAnimationEffect ];// 禁用手指点击曲线或者掠过曲线后,曲线变粗的动画效果
123123 case 40 : return [self configurePieChartFormatProperty ];// 配置饼图的 dataLabels 的 format 属性
124- case 41 : return [self customXAxisLabelsBeImages ];
125-
124+ case 41 : return [self customXAxisLabelsBeImages ];// 自定义曲线面积图 X 轴 labels 为一组图片🖼
125+ case 42 : return [self configureTriangleRadarChart ];// 带有颜色标志带的三角形雷达图
126+ case 43 : return [self configureQuadrangleRadarChart ];// 带有颜色标志带的四角形雷达图
127+ case 44 : return [self configurePentagonRadarChart ];// 带有颜色标志带的五角形雷达图
128+ case 45 : return [self configureHexagonRadarChart ];// 带有颜色标志带的六角形雷达图
126129 }
127130 return nil ;
128131}
@@ -2495,4 +2498,187 @@ - (AAOptions *)customXAxisLabelsBeImages {
24952498 aaOptions.xAxis .labels .useHTML = true ;
24962499 return aaOptions;
24972500}
2501+
2502+ // 三角形雷达图
2503+ - (AAOptions *)configureTriangleRadarChart {
2504+ AAChartModel *aaChartModel = AAChartModel.new
2505+ .chartTypeSet (AAChartTypeArea)
2506+ .backgroundColorSet (AAColor.whiteColor )
2507+ .markerRadiusSet (@0 )
2508+ .yAxisMaxSet (@25 )
2509+ .yAxisGridLineWidthSet (@1 )
2510+ .polarSet (true )
2511+ .legendEnabledSet (false )
2512+ .tooltipEnabledSet (false )
2513+ .xAxisGridLineWidthSet (@1 )
2514+ .yAxisGridLineWidthSet (@1 )
2515+ .xAxisCrosshairWidthSet (@1.5 )
2516+ .xAxisCrosshairColorSet (AAColor.whiteColor )
2517+ .xAxisCrosshairDashStyleTypeSet (AAChartLineDashStyleTypeLongDashDotDot)
2518+ .yAxisCrosshairWidthSet (@1.5 )
2519+ .yAxisCrosshairColorSet (AAColor.whiteColor )
2520+ .yAxisCrosshairDashStyleTypeSet (AAChartLineDashStyleTypeLongDashDotDot)
2521+ .yAxisTickPositionsSet (@[@5 ,@10 ,@15 ,@20 ,@25 ,])
2522+ .seriesSet (@[
2523+ AASeriesElement.new
2524+ .colorSet (AAColor.whiteColor)
2525+ .fillOpacitySet (@0.01 )
2526+ .dataLabelsSet (AADataLabels.new
2527+ .colorSet (AARgbaColor (30 , 144 , 255 , 1.0 )))
2528+ .dataSet (@[@17.0 , @16.9 , @12.5 ,]),
2529+ ]);
2530+
2531+ AAOptions *aaOptions = [AAOptionsConstructor configureChartOptionsWithAAChartModel: aaChartModel];
2532+ aaOptions.yAxis .gridLineInterpolation = AAYAxisGridLineInterpolationPolygon;
2533+
2534+ aaOptions.xAxis .lineWidth = @0 ;// 避免多边形外环之外有额外套了一层无用的外环
2535+ aaOptions.xAxis .gridLineColor = AARgbaColor (30 , 144 , 255 , 0.6 );
2536+ aaOptions.yAxis .gridLineColor = AARgbaColor (30 , 144 , 255 , 1.0 );
2537+
2538+ NSArray *aaPlotBandsArr = @[
2539+ AAPlotBandsElement.new
2540+ .fromSet (@0 )
2541+ .toSet (@5 )
2542+ .colorSet (AARgbaColor (30 , 144 , 255 , 1.0 )),
2543+ AAPlotBandsElement.new
2544+ .fromSet (@5 )
2545+ .toSet (@10 )
2546+ .colorSet (AARgbaColor (30 , 144 , 255 , 0.8 )),
2547+ AAPlotBandsElement.new
2548+ .fromSet (@10 )
2549+ .toSet (@15 )
2550+ .colorSet (AARgbaColor (30 , 144 , 255 , 0.6 )),
2551+ AAPlotBandsElement.new
2552+ .fromSet (@15 )
2553+ .toSet (@20 )
2554+ .colorSet (AARgbaColor (30 , 144 , 255 , 0.4 )),
2555+ AAPlotBandsElement.new
2556+ .fromSet (@20 )
2557+ .toSet (@25 )
2558+ .colorSet (AARgbaColor (30 , 144 , 255 , 0.2 )),
2559+ ];
2560+
2561+ AAYAxis *aaYAxis = aaOptions.yAxis ;
2562+ aaYAxis.plotBands = aaPlotBandsArr;
2563+ return aaOptions;
2564+ }
2565+
2566+ // 四边形雷达图
2567+ - (AAOptions *)configureQuadrangleRadarChart {
2568+ AAOptions *aaOptions = [self configureTriangleRadarChart ];
2569+ aaOptions.yAxis .plotBands = @[
2570+ AAPlotBandsElement.new
2571+ .fromSet (@0 )
2572+ .toSet (@5 )
2573+ .colorSet (AARgbaColor (255 , 0 , 0 , 1.0 )),
2574+ AAPlotBandsElement.new
2575+ .fromSet (@5 )
2576+ .toSet (@10 )
2577+ .colorSet (AARgbaColor (255 , 0 , 0 , 0.8 )),
2578+ AAPlotBandsElement.new
2579+ .fromSet (@10 )
2580+ .toSet (@15 )
2581+ .colorSet (AARgbaColor (255 , 0 , 0 , 0.6 )),
2582+ AAPlotBandsElement.new
2583+ .fromSet (@15 )
2584+ .toSet (@20 )
2585+ .colorSet (AARgbaColor (255 , 0 , 0 , 0.4 )),
2586+ AAPlotBandsElement.new
2587+ .fromSet (@20 )
2588+ .toSet (@25 )
2589+ .colorSet (AARgbaColor (255 , 0 , 0 , 0.2 )),
2590+
2591+ ];
2592+
2593+ aaOptions.xAxis .gridLineColor = AARgbaColor (255 , 0 , 0 , 0.6 );
2594+ aaOptions.yAxis .gridLineColor = AARgbaColor (255 , 0 , 0 , 1.0 );
2595+
2596+ AASeriesElement *element = aaOptions.series [0 ];
2597+ element.dataSet (@[@17.0 , @16.9 , @12.5 , @14.5 ,])
2598+ .dataLabelsSet (AADataLabels.new
2599+ .colorSet (AARgbaColor (255 , 0 , 0 , 1.0 )))
2600+ ;
2601+
2602+ return aaOptions;
2603+ }
2604+
2605+ // 五边形雷达图
2606+ - (AAOptions *)configurePentagonRadarChart {
2607+ AAOptions *aaOptions = [self configureTriangleRadarChart ];
2608+ aaOptions.yAxis .plotBands = @[
2609+ AAPlotBandsElement.new
2610+ .fromSet (@0 )
2611+ .toSet (@5 )
2612+ .colorSet (AARgbaColor (255 , 215 , 0 , 1.0 )),
2613+ AAPlotBandsElement.new
2614+ .fromSet (@5 )
2615+ .toSet (@10 )
2616+ .colorSet (AARgbaColor (255 , 215 , 0 , 0.8 )),
2617+ AAPlotBandsElement.new
2618+ .fromSet (@10 )
2619+ .toSet (@15 )
2620+ .colorSet (AARgbaColor (255 , 215 , 0 , 0.6 )),
2621+ AAPlotBandsElement.new
2622+ .fromSet (@15 )
2623+ .toSet (@20 )
2624+ .colorSet (AARgbaColor (255 , 215 , 0 , 0.4 )),
2625+ AAPlotBandsElement.new
2626+ .fromSet (@20 )
2627+ .toSet (@25 )
2628+ .colorSet (AARgbaColor (255 , 215 , 0 , 0.2 )),
2629+
2630+ ];
2631+
2632+ aaOptions.xAxis .gridLineColor = AARgbaColor (255 , 215 , 0 , 0.6 );
2633+ aaOptions.yAxis .gridLineColor = AARgbaColor (255 , 215 , 0 , 1.0 );
2634+
2635+ AASeriesElement *element = aaOptions.series [0 ];
2636+ element.dataSet (@[@17.0 , @16.9 , @12.5 , @14.5 , @18.2 ,])
2637+ .dataLabelsSet (AADataLabels.new
2638+ .colorSet (AARgbaColor (255 , 215 , 0 , 1.0 )))
2639+ ;
2640+
2641+ return aaOptions;
2642+ }
2643+
2644+ // 六边形雷达图
2645+ - (AAOptions *)configureHexagonRadarChart {
2646+ AAOptions *aaOptions = [self configureTriangleRadarChart ];
2647+ aaOptions.yAxis .plotBands = @[
2648+ AAPlotBandsElement.new
2649+ .fromSet (@0 )
2650+ .toSet (@5 )
2651+ .colorSet (AARgbaColor (50 , 205 , 50 , 1.0 )),
2652+ AAPlotBandsElement.new
2653+ .fromSet (@5 )
2654+ .toSet (@10 )
2655+ .colorSet (AARgbaColor (50 , 205 , 50 , 0.8 )),
2656+ AAPlotBandsElement.new
2657+ .fromSet (@10 )
2658+ .toSet (@15 )
2659+ .colorSet (AARgbaColor (50 , 205 , 50 , 0.6 )),
2660+ AAPlotBandsElement.new
2661+ .fromSet (@15 )
2662+ .toSet (@20 )
2663+ .colorSet (AARgbaColor (50 , 205 , 50 , 0.4 )),
2664+ AAPlotBandsElement.new
2665+ .fromSet (@20 )
2666+ .toSet (@25 )
2667+ .colorSet (AARgbaColor (50 , 205 , 50 , 0.2 )),
2668+
2669+ ];
2670+
2671+ aaOptions.xAxis .gridLineColor = AARgbaColor (50 , 205 , 50 , 0.6 );
2672+ aaOptions.yAxis .gridLineColor = AARgbaColor (50 , 205 , 50 , 1.0 );
2673+
2674+ AASeriesElement *element = aaOptions.series [0 ];
2675+ element.dataSet (@[@17.0 , @16.9 , @12.5 , @14.5 , @18.2 , @21.5 ,])
2676+ .dataLabelsSet (AADataLabels.new
2677+ .colorSet (AARgbaColor (50 , 205 , 50 , 1.0 )))
2678+ ;
2679+
2680+ return aaOptions;
2681+ }
2682+
2683+
24982684@end
0 commit comments