0

嗨,我正在使用以下示例:

http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/stock/members/axis-setcompare/

如何更改 y 轴上的值的格式。例如,当我选择百分比时,我希望值显示为 +25%。我现在如何最初设置它,但如何使用 Jquery 脚本更改它。

formatter: function () {
return (this.value > 0 ? '+' : '') + this.value + '%';
}

/S

4

2 回答 2

0

如果您在工具提示中使用格式化程序,您应该使用 this.y 而不是 this.value。

     formatter: function() {
return (this.y > 0 ? '+' : '') + this.y;
                }

http://jsfiddle.net/6neGD/1/

于 2013-07-10T11:41:39.537 回答
0

我解决了。只需使用

chart.options.yAxis[0].labels.format = '{value} %'; 

以百分比显示标签

于 2013-07-13T19:55:10.960 回答