Closed NSMichael closed 5 years ago
如下配置AAOptions实例对象
AAChartModel *aaChartModel= AAChartModel.new
.chartTypeSet(AAChartTypeAreaspline)
.titleSet(@"")
.subtitleSet(@"")
.stackingSet(AAChartStackingTypeNormal)
.markerRadiusSet(@0)
.colorsThemeSet(@[
[AAGradientColor oceanBlueColor],
[AAGradientColor sanguineColor],
[AAGradientColor lusciousLimeColor],
[AAGradientColor mysticMauveColor],
])
.seriesSet(@[
AASeriesElement.new
.nameSet(@"Tokyo Hot")
.dataSet(@[@0.45, @0.43, @0.50, @0.55, @0.58, @0.62, @0.83, @0.39, @0.56, @0.67, @0.50, @0.34, @0.50, @0.67, @0.58, @0.29, @0.46, @0.23, @0.47, @0.46, @0.38, @0.56, @0.48, @0.36]),
AASeriesElement.new
.nameSet(@"Berlin Hot")
.dataSet(@[@0.38, @0.31, @0.32, @0.32, @0.64, @0.66, @0.86, @0.47, @0.52, @0.75, @0.52, @0.56, @0.54, @0.60, @0.46, @0.63, @0.54, @0.51, @0.58, @0.64, @0.60, @0.45, @0.36, @0.67]),
AASeriesElement.new
.nameSet(@"London Hot")
.dataSet(@[@0.46, @0.32, @0.53, @0.58, @0.86, @0.68, @0.85, @0.73, @0.69, @0.71, @0.91, @0.74, @0.60, @0.50, @0.39, @0.67, @0.55, @0.49, @0.65, @0.45, @0.64, @0.47, @0.63, @0.64]),
AASeriesElement.new
.nameSet(@"NewYork Hot")
.dataSet(@[@0.60, @0.51, @0.52, @0.53, @0.64, @0.84, @0.65, @0.68, @0.63, @0.47, @0.72, @0.60, @0.65, @0.74, @0.66, @0.65, @0.71, @0.59, @0.65, @0.77, @0.52, @0.53, @0.58, @0.53]),
]
);
AAOptions *aaOptions = [AAOptionsConstructor configureChartOptionsWithAAChartModel:aaChartModel];
aaOptions.legend = AALegend.new
.enabledSet(true)
.alignSet(AALegendAlignTypeRight)
.layoutSet(AALegendLayoutTypeVertical)
.verticalAlignSet(AALegendVerticalAlignTypeTop);
aaOptions.yAxis.labels.format = @"{value} %";//给y轴添加单位
即可.
关键语句:
aaOptions.yAxis.labels.format = @"{value} %";//给y轴添加单位
效果图: