score:0

Accepted answer

Original object with data from user could be find in this.options.y, so you can always use that value, see: http://jsfiddle.net/bRZaw/9/

score:1

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.

score:1

You can show 0 for negative numbers in legend by updating labelFormatter as below:

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

http://jsfiddle.net/bRZaw/3/


Related Articles