AAChartKit
AAChartKit copied to clipboard
value为0时,如何让datalabel不显示0
dataLabels.formatter = @AAJSFunc(function (){
let length = this.points.length;
for (let i = 0; i < length; i++) {
let thisPoint = this.points[i];
let yValue = thisPoint.y;
if (yValue != 0) {
return yValue;
}
}
});
但是0 还是显示了
AAOptions *options = [aaChartModel aa_toAAOptions]; options.plotOptions.series.events = @{@"legendItemClick":@"false"}; AADataLabels *dataLabels = options.plotOptions.column.dataLabels; dataLabels.verticalAlign = @"top"; dataLabels.y = @-20; dataLabels.allowOverlap = true; dataLabels.crop = false; dataLabels.overflow = @"none"; dataLabels.formatter = @AAJSFunc(function (){
let length = this.points.length;
for (let i = 0; i < length; i++) {
let thisPoint = this.points[i];
let yValue = thisPoint.y;
if (yValue != 0) {
return yValue;
}
}
});