Line chart with multiple Y axis doesn't support crosshair on all Lines

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 Stephan on 6th February 2014
Hi,

I am trying to create a graph with rain and humidity together (for my weather webpage). But what ever I try to do I can't seem to get the crosshair to work for the second line.

You can see it at: io-node.net/weather2/12hours.php

It is the bottom graph that isn't as I would like it (e.g. double crosshairs) as does work with the other 2 graphs on the same page.

Thanks,

Stephan
Posted by Richard on 7th February 2014
Hi there,

Because you're using two chart objects one will 'hog' (be greedy) the crosshairs. You could put both lines on the same chart object (the blue one). You'll need to adjust the values which you could do like this:

values = [97,86,87,91,92,93];

for (var i=0; i<values.length; ++i) {
     values[i] = (values[i] / 100) * 3;
}

// Where 100 is the maximum humidity (100%) and 3 is the max rainfall (3mm).


Richard, RGraph Support
www.rgraph.net
Please link to the RGraph website
Posted by Stephan on 7th February 2014
Hi Richard,

That did the job. Thanks. Will keep that in mind for future graphs.

Stephan

Add a reply




« Back to message list