0
votes

I have a Highcharts graph similar to the this (http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/area-stacked-percent/).

The only part I have not been able to get working is formatting the percentage values that appear on the tooltip. If I put the below code then the percentage value shows up but it has too many decimal places...

tooltip: {
    pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.percentage}%</b><br/>',
    shared: true
}

But if I have I tried to format the value of point.percentage to show less decimal places like so...

{ point.percentage:.1f }%

then only the literal "{point.percentage:.1f}%" shows up in the graph tooltip.

Does anyone have any suggestions on what could be wrong? Is there any other way to format that percentage value other than the above?

Thanks.

2
question contradicts with explanation; it suppose to be tool tip formatting!wpcoder
I had the same problem and made it work by setting the tooltip options for each series.Waruyama

2 Answers

2
votes

I think the approach is working, according to this fiddle: http://jsfiddle.net/ethanph5/VSKx3/

The snippet you are interested:

tooltip: {
    pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.percentage:.1f}%</b><br/>',
    shared: true
}