Tooltip with percentage value

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by vrushali on 7th June 2013
Hi,

I want show each slice of pie chart and bar graph with percentage value(ex. weather it is 20% or 90%).How to show that?


Thanks and Regards,
vrushali
Posted by RGraph support on 7th June 2013
Hi there,

Convert your data to percentages. eg If you have a dataset like this:

myData = [1,5,6,8,4]

You could do this:

sum = RGraph.array_sum(myData)
myData[0] = (mydata[0] / sum) * 100; // 4.17%
myData[1] = (mydata[1] / sum) * 100; // 20.83%
myData[2] = (mydata[2] / sum) * 100; // 25%
myData[3] = (mydata[3] / sum) * 100; // 33.33%
myData[4] = (mydata[4] / sum) * 100; // 16.67%


Richard, RGraph Support

5 developer license with Priority support for £299:
   www.rgraph.net/license#five-developer
Posted by vrushali on 7th June 2013
I want to show that percentage value as tooltip in pie-chart and bar chart both.How can I show that?
Posted by RGraph support on 7th June 2013
Hi there,

Simply use the same calculation and use the result in your tooltips. Tooltips are HTML DIV tags so you can use text, HTML or both.




Richard, RGraph Support

5 developer license with Priority support for £299:
   www.rgraph.net/license#five-developer

Add a reply




« Back to message list