I give that values to Highcharts pie chart:
series:[
{
type:'pie',
name:'Ratio',
data:[
['A', 42.6],
{
name:'B',
y:14.2,
sliced:true,
selected:true
}
]
}
]
However it shows it like that at pie chart:
A -> 75.00000000000001 %
B-> 25 %
You can format tooltips at Highcharts how about chart values?
plotOptions.pie.dataLabels.formatter
is a function that will let you format the label. In this case I returnedthis.percentage.toFixed(2)
which will trim your number at 2 decimal places. Demo at this jsFiddleThis will give you the percentage value
this is not for formating the values .
the formart of the values can be change in the dataLables in the data .
You can just format it like this below.
documentation about Highcharts formatting
We do have tooltip formatter options to display the value as number instead of percentage
http://api.highcharts.com/highstock#tooltip.formatter
this.point.y will do the trick (now you have this.percentage in that place)