AAChartKit icon indicating copy to clipboard operation
AAChartKit copied to clipboard

value为0时,如何让datalabel不显示0

Open a123478we opened this issue 3 years ago • 1 comments

截屏2022-02-07 14 04 25 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 还是显示了

a123478we avatar Feb 07 '22 06:02 a123478we

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;
                }
            }
            
        });

a123478we avatar Feb 07 '22 06:02 a123478we