Scatter chart: multiple data sets in single argument doesn't work when X axis coded as date string

« 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 Chris Ghormley on 23rd February 2013
I am trying to get a variable number of lines on a scatter plot. My code retrieves an array of arrays containing data in a time range from the server. I'm taking advantage of the relatively recent date string support. The code in RGraph.scatter.js tests for the type of data structure with the following:

if (arguments[1][0] && arguments[1][0][0] && typeof(arguments[1][0][0][0]) == number') {

But if I'm using date strings in my data sets, the third test in the if statement fails. I know I can initialize RGraph.Scatter() with a variable number of arguments, but it would be easier for my application if this worked.
Posted by RGraph support on 24th February 2013
Hi there,

I'll add the check for whether it's a string or a number in.

Richard, RGraph support
RGraph - HTML5 and Javascript charts
Posted by Keith Ford on 11th March 2013
How are you getting multiple data sets? I'm trying to do a scatter plot with line enabled and produce multiple lines, but can't seem to feed in the correct data.
Posted by Keith Ford on 11th March 2013
Nevermind, here is the solution, just like the line chart:

         var scatter = new RGraph.Scatter('cvs',
                 [['2012/02/12 15:51:55', 5], ['2012/03/01 21:45',10]],
                 [['2012/02/17 15:51:55', 3], ['2012/03/01 21:45',5]]

Add a reply


« Back to message list
RGraph on social media