Hi Guys,
I am using pie chart normally but I don´t know how to enable the percent value during the hover presentation. Someone has some tip ?
Thanks
After doing a lot of research I could join the pieces. It was not easy and I would like to thank you guys for your tips.
I had to add the code below to to the advancedFormat option in the pie chart gadget. So I am leaving this code to someone would like to have the same result as mine.
SyntaxEditor Code Snippet
AdvancedFormat_Init(DataPointFormats:,DataSeriesFormats:,XAxisJSON:,YAxisJSON:,HighchartsJSON: "tooltip: { enabled: true, formatter: function() { return this.point.name +': '+ this.point.y +' (<b>'+this.percentage.toFixed(1) +'</b>%)';}}")
The hoveer shows the value in Tooltip. You have to pass the % value into Tooltip.
There is no sense Nuno. The chart calculates de percent value. Why I should calculate and provide it into the Tooltip ?
Did you try use the formatter as explained here?
Best regards,
PC
Luciano Schiavo wrote:
I was about to say "The way I see it, someone wants to show %, another wants to show relative value, another the absolute value, another the text, another text (%)... A single box for everything is easier that to guess want everyone wants. If they could do a best guess it would be really great." and
Pedro Coelho wrote:
Just perfect.
Sorry guys,
I am trying to see the connection between tooltip and the pie chart that is available in Charts widget. Maybe I don´t have knowledge for that. Could you explain this better ?
Luck
Thanks Luciano. Was looking for this also, and it's not easy indeed :-)
Just copied your code snippet and it worked for me as well!
Charles Betman wrote:
You are welcome
Thank you so much Luciano for that code snippet! I wanted the percentage on my charts too, and it was super simple just coping that snippet and pasting it in the advanced format in all my charts. You are awesome! :)
Thank you so much Luciano!
I had to add the code below to to the advancedFormat option in the pie chart gadget.
AdvancedFormat_Init(DataPointFormats:,DataSeriesFormats:,XAxisJSON:,YAxisJSON:,HighchartsJSON: "plotOptions: { pie: { allowPointSelect: true, cursor: 'pointer', dataLabels: { enabled: true, format: '{point.percentage:.1f} %', style: { color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' } } } }")