Accepted answer

original object with data from user could be find in this.options.y, so you can always use that value, see:


pie charts are supposed to represent a part of a total so it is expected that negative numbers won't work because you can't have a negative part of a total. if you need to represent negative values then you probably should use another type of chart.

in case that you actually want to just show that value (given that you said it isn't really significant over all), try wrapping it in an absolute value, math.abs(yourvalue) should do the trick.


you can show 0 for negative numbers in legend by updating labelformatter as below:

labelformatter: function () {
    if (this.y === null) {
        return + ': 0%';
    } else {
        return + ': ' + this.y + '%';

Related Query

More Query from same tag