@@ -110,6 +110,7 @@ - (AAChartModel *)setUpAAChartModelWithIndex:(NSUInteger)index {
110110 case 23 : return [self configurePentagonRadarChart ];
111111 case 24 : return [self configureHexagonRadarChart ];
112112 case 25 : return [self adjustYAxisMaxAndMinValues ];
113+ case 26 : return [self customSpecialStyleDataLabelOfSingleDataElementChart ];
113114
114115 default :
115116 return nil ;
@@ -903,6 +904,55 @@ - (AAChartModel *)adjustYAxisMaxAndMinValues {
903904
904905
905906
907+ - (AAChartModel *)customSpecialStyleDataLabelOfSingleDataElementChart {
908+ NSDictionary *gradientColorDic1 =
909+ [AAGradientColor gradientColorWithDirection: AALinearGradientDirectionToTop
910+ startColorString: @" rgba(255,215,0,0.1)" // gold color, alpha: 0.1
911+ endColorString: @" rgba(255,215,0, 0.6)" ]; // gold color, alpha: 0.6
912+
913+ NSString *formatStr = [NSString stringWithFormat: @" %@%@ " ,
914+ @" <span style=" " color:#FFFFFF;font-weight:thin;font-size:25px" " >▲{y}</span>" ,
915+ @" <span style=" " color:#FFFFFF;font-weight:thin;font-size:17px" " > m</span>"
916+ ];
917+
918+ AADataElement *singleSpecialData = AADataElement.new
919+ .dataLabelsSet (AADataLabels.new
920+ .enabledSet (true )
921+ .useHTMLSet (true )
922+ .formatSet (formatStr)
923+ .styleSet (AAStyle.new
924+ .fontWeightSet (AAChartFontWeightTypeBold)
925+ .colorSet (AAColor.whiteColor )
926+ .fontSizeSet (@" 16px" ))
927+ .ySet (@(-35 ))
928+ .alignSet (AAChartAlignTypeCenter)
929+ .verticalAlignSet (AAChartVerticalAlignTypeTop)
930+ .overflowSet (@" none" )
931+ .cropSet (false )
932+ )
933+ .ySet (@26.5 );
934+
935+ return AAChartModel.new
936+ .chartTypeSet (AAChartTypeAreaspline)
937+ .titleSet (@" " )
938+ .backgroundColorSet (@" #4b2b7f" )
939+ .yAxisTitleSet (@" " )// 设置Y轴标题
940+ .dataLabelsEnabledSet (false )// 是否显示值
941+ .tooltipEnabledSet (true )
942+ .markerRadiusSet (@0 )
943+ .xAxisVisibleSet (false )
944+ .yAxisVisibleSet (false )
945+ .seriesSet (@[
946+ AASeriesElement.new
947+ .nameSet (@" Virtual Data" )
948+ .lineWidthSet (@6 )
949+ .colorSet (@" rgba(255,215,0,1)" )
950+ .fillColorSet ((id )gradientColorDic1)// gold color, alpha: 1.0
951+ .dataSet (@[@7.0 , @6.9 , @2.5 , @14.5 , @18.2 , singleSpecialData, @5.2 , @26.5 , @23.3 , @45.3 , @13.9 , @9.6 ])
952+ ]);
953+ }
954+
955+
906956
907957@end
908958
0 commit comments