Closed 13662049573 closed 1 year ago
你这个问题通过调整 Y 轴的最大值和最小值来解决, 参考:
示例代码如下:
//https://github.com/AAChartModel/AAChartKit/issues/519
- (AAChartModel *)adjustYAxisMaxAndMinValues {
NSArray *categoriesArr = @[
@"孤岛危机",
@"使命召唤",
@"荣誉勋章",
@"狙击精英",
@"神秘海域",
@"最后生还者",
@"巫师3狂猎",
@"对马之魂",
@"蝙蝠侠阿甘骑士",
@"地狱边境",
@"闪客",
@"忍者之印"
];
return AAChartModel.new
.chartTypeSet(AAChartTypeAreaspline)
.legendEnabledSet(false)
.yAxisVisibleSet(true)
.markerRadiusSet(@6)
.markerSymbolStyleSet(AAChartSymbolStyleTypeInnerBlank)
.zoomTypeSet(AAChartZoomTypeXY)
.tooltipValueSuffixSet(@"kg")
.categoriesSet(categoriesArr)
.yAxisMinSet(@2.0)
.yAxisMaxSet(@45.4)
.xAxisTickIntervalSet(@2)
.seriesSet(@[
AASeriesElement.new
.nameSet(@"体重")
.colorSet(@"#2494F3")
.dataSet(@[@7.0, @6.9, @2.5, @14.5, @18.2, @21.5, @5.2, @26.5, @23.3, @45.3, @13.9, @9.6])
]);
}
你可能没有理解我的意思,不是你说的最大值和最小值问题
你可能没有理解我的意思,不是你说的最大值和最小值问题
麻烦你看看了,需求是这样的
参考 Highcharts 的 Y 轴属性 tickInterval
在线 API:
对应的 AAChartKit 中的 AAYAxis
属性:
AAPropStatementAndPropSetFuncStatement(strong, AAYAxis, NSNumber *, tickInterval)
另外还可以查看这个 Y 轴的这个 tickPositions 属性
对应的 AAChartKit 中的 AAYAxis
属性:
AAPropSetFuncImplementation(AAYAxis, NSArray *, tickPositions) //自定义Y轴坐标(如:[@(0), @(25), @(50), @(75) , (100)])
假如我有三个数据 78,79,80 ,现在的曲线幅度不是很大,Y轴的间距默认好像是1 ,所以看不到很大的幅度曲线效果,现在问题,如何去修改Y轴之间的曲线幅度大小,修改后的效果看到曲线就是一条下滑很大曲线幅度,Y轴间距也很大。麻烦一下。