Line chart: Need 2 lines of differing lengths

Share RGraph:   Share or Like RGraph on Facebook!

« 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 Keith Fowler on 4th April 2013
I have a chart that represents Numeric Values (Y) over Time (X).

One line represents TODAY'S values and the second line represents Last Year's values.

Since I have complete data for Last Year it should span the entire chart. However, I only want the Today's line to draw to the current hour. Right now, it draws across the whole chart.
Posted by Keith Fowler on 4th April 2013
Well, it took me a bit, but I finally discovered how to resolve my problem.

RGraph.array_pad(array, length[, value])

var curValues = RGraph.array_pad(currentYValues, LastYearsYValues.length);

This effectively made both arrays the same size and placed nulls into currentYValues.

Now the chart appears as I want it to. On to adding some tooltips! Having fun with RGraph!

Add a reply




« Back to message list