Tooltip does not work on negative values in the Line chart

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 Camilato on 11th January 2016
Hi Ralph,

First of all I want to thank the great work you have done.

I need your help for resolve tooltips in negative values in the line graph.

Here is the link to my exemple: js.do/caecamilato/79433
Posted by Richard on 11th January 2016
Hi,

Since you haven't specified I'll assume the issue is that the negative tooltips aren't showing. ISTR a similar post about this and the issue was the stacking order (the drawing API objects were being placed over the Line chart). So you can see if this is the same issue by commenting out all of the drawing API objects .

OR

You could move your first Line chart down in the src code so it's just before the other Line chart (and after all of the drawing API objects).




Richard
Posted by Camilato on 15th February 2016
Hi Richard,

I think with found the location of the problem.

/**
         * The getObjectByXY() worker method. Don't call this call:
         *
         * RG.ObjectRegistry.getObjectByXY(e)
         *
         * @param object e The event object
         */
         this.getObjectByXY = function (e)
         {
             //var ca = this.canvas;
             //var prop = this.properties;
             var mouseXY = RG.getMouseXY(e);
    
             // The 5 is so that the cursor doesn't have to be over the graphArea to trigger the hotspot
             if (
                    (mouseXY[0] > prop['chart.gutter.left'] - 5)
                 && mouseXY[0] < (ca.width - prop['chart.gutter.right'] + 5)
                 && mouseXY[1] > (prop['chart.gutter.top'] - 5)
                 && mouseXY[1] < (ca.height - prop['chart.gutter.bottom'] + 5)
                 ) {
    
                 return this;
             }
         };

I think it may be because subtraction height gutter bottom, then the area where the event listening mouse movement is not found to the underside. That's because to use the chart with a negative value and multiple lines has multiple instances of line graph with background. Now I do not know if the way I did to have multiple lines with the possibility of negative values is correct that way implemented for me. I reference the combination of two examples of the site to be able to make a graphic with multiple line and accept negative values.

Here:

www.rgraph.net/demos/line-quarter-axis.html

www.rgraph.net/demos/line-multiple-y-axes.html

Add a reply




« Back to message list