My chart cannot process my data which is coming from an array variable (floats)

« 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 Sherlocked on 21st November 2013
Im doing a graph pie and the data is coming from an array(float).
The problem is, whatever I do, rgraph cannot process and cant display the graph that I need.

Here's the code:

var m = [parseFloat(cAmount[0]) , parseFloat(cAmount[1]) , parseFloat(cAmount[2]) , parseFloat(cAmount[3]) , parseFloat(cAmount[4]), parseFloat(cAmount[5]) , parseFloat(cAmount[6]) , parseFloat(cAmount[7]) , parseFloat(cAmount[8]) , parseFloat(cAmount[9])];
var pie = new RGraph.Pie('cvs', m);
.Set('chart.labels', dataLabel)
.Set('chart.stroke', 'white')
Posted by RGraph support on 21st November 2013
Hi there,

Hi there,

At a guess your m array isn't quite what you think it is. You can see
what it contains by using the p() function (which is a glorified
alert() ). So just before you create the Pie object do this:


That will show you what it contains and the types.

Richard, RGraph Support

Add a reply

« Back to message list