Scatter does not show some tooltips

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 malaise on 24th November 2015
Hi,
in malaise.hd.free.fr/meteo/TempPressKO.html I draw 2 scatters with the same X axis and similar policy to set the tooltips. The second scatter is OK but the first one (temperatures) does not display some tooltips when the mouse is over the curve.
Ex, of missing tooltips, on the right part:
From 11-23T22 to 11-24T04 included, and 11-24T10

Note: the X scale is <month>-<day>T<hour> and the tooltip is
X/Y

Thanks in advance for any explanation
Posted by Richard on 24th November 2015
Hi there,

I don't know why it's not showing up. After inspecting the canvas you can see the tooltip being set by looking at the objects data array (via the canvas element).

I would suggest that you start with getShape() function and go through it checking all of the values in the function when you hover over the point(s) with missing tooltips, with the $p() function (an RGraph function which dumps/alert()s the variable that you pass it so that you can see its structure) Eg.

$p(variable);




Richard
Posted by malaise on 1st December 2015
The problem seems related to the negative values on the Y axis.
Posted by Richard on 1st December 2015
Hi,

So add some test data to the chart to check. Or perhaps replace all of the data that you've got there with artificial data (with a mix of positive/negative data).

Richard
Posted by malaise on 1st December 2015
Hello,
this is what I have done in:
malaise.hd.free.fr/meteo/TempPressKO1.html

Some negative values are shown (tooltip appears) but the tooltips do not appear around the crossing of the zero (both ways).

Thank you
Posted by Richard on 1st December 2015
Hi,

I don't know why its not showing. Can you replicate it with a very simple (along the same lines as the demo pages - www.rgraph.net/demos/index.html ) Scatter chart? Or is it specific to this chart?

Try to replicate the issue with a small data set - eg 10 points. Use similar values as the chart.





Richard
Posted by malaise on 1st December 2015
Hello,
I have got two new clues, see malaise.hd.free.fr/meteo/TempPressSimple.html

- The failure to show occurs for "small" negative values:
It shows OK from 2 to 0 but not for -1 nor -2, and it is Ok again with -3.

- The problem does not occur if I remove the XAxis.

Regards
Posted by Richard on 2nd December 2015
Hi there,

> The problem does not occur if I remove the XAxis.

Ah. Then what it may be is down to the order of the drawing - ie the X axis is sitting on top of the Scatter and is receiving the mouse events before the Scatter chart does.
So you can try one of two things:



1. When both the Scatter and X axis have been drawn - and configured you can do this:

RGraph.ObjectRegistry.bringToFront(templine);



2. Draw the X axis before the Scatter chart.





Richard
Posted by malaise on 2nd December 2015
Hello,
this explanation sounds promising but
Solution 2 works but the X axis becomes hidden by the grid of the scatter.
Solution 1 does not seam to work.

See new
pmahome.cigecompta.fr/meteo/TempPressSimple.html
the tooltips of 11-30T04 and T05 are not shown

Thanks
Posted by Richard on 2nd December 2015
Hi there,

1. You're missing an R on the bringToFront line:


    RGraph.ObjectRegistry.bringToFront(templine);
    ^

2. Try Turning off the background grid on the Scatter chart:

...
backgroundGrid: false
...




To help me debug this, can you put everything - including the data - in the HTML page. Denying me access to your data does not make it easy.




Richard
Posted by malaise on 3rd December 2015
Hello,
1. Sorry for the mistake. Also I need to insert the statement within the CSV, otherwise it has not effect.
Within the CSV, this works but the X Axis is hidden.
I have modified
malaise.hd.free.fr/meteo/TempPressSimple.html
to reflect this attempt

2. If I do that there is no grid anymore

The data is public (I can get it with wget for example). Anyway here is the content of the file weekSimple.dat

2015-11-30T00:00:00,2.0
2015-11-30T01:00:00,1.0
2015-11-30T02:00:00,0.1
2015-11-30T03:00:00,0.0
2015-11-30T04:00:00,-1.0
2015-11-30T05:00:00,-2.0
2015-11-30T06:00:00,-3.0
2015-11-30T07:00:00,-4.0

I will merge data in file this evening, if this is still necessary.

Regards
Posted by Richard on 3rd December 2015
Hi,

If you turn off the background grid then yes - there won't be a background grid any more. You could use the drawing API background grid before drawing the X axis.


www.rgraph.net/docs/drawing-api-background.html




Richard
Posted by malaise on 3rd December 2015
Hi,
Solution 2 with drawing the background grid, then the X axis, then the scatter, works fine. See: malaise.hd.free.fr/meteo/TempPressTry.html

Please tell me if you need help for solution 1 and if you can make it work, otherwise I will go for the solution above.

Thank you
Posted by Richard on 3rd December 2015
Hi there,

Stick with what you have as it works.





Richard

Add a reply




« Back to message list