Note that there are some explanatory texts on larger screens.

plurals
  1. POJQplot tooltip for multiple y axes
    primarykey
    data
    text
    <p>For a JQplot chart with 2 y axes, I am able to set the tooltip but when i hover over a datapoint i need to know to which y axis the tooltip belongs. I need this so that i can display the tooltip after multiplying with the appropriate scale factor. The code i tried is shown below. I thought y will be null when we hover over a data point belonging to y2 axis. But y is never null.</p> <pre><code> $("#"+sTargetId).bind('jqplotcustomDataMouseOver', function (ev, seriesIndex, pointIndex, data) { var chart_left = $("#"+sTargetId).offset().left, chart_right = ($(window).width() - ($("#"+sTargetId).offset().left + $("#"+sTargetId).outerWidth())), chart_top = $("#"+sTargetId).offset().top, x = oPlot.axes.xaxis.u2p(data[0]), y = oPlot.axes.yaxis.u2p(data[1]), y2 = oPlot.axes.y2axis.u2p(data[1]);; if(y===null|| y===undefined){ //this condition doesnt work var tooltipDataYaxis = data[1]*scaleYaxis1; var sYDisplay = this.sYAxis1MeasureName; $('#tooltip').css({left:chart_left+x, top:chart_top+y, marginRight:chart_right}); } else{ tooltipDataYaxis = data[1]*scaleYaxis2; sYDisplay = this.sYAxis2MeasureName; $('#tooltip').css({left:chart_left+x, top:chart_top+y2, marginRight:chart_right}); } $('#tooltip').html( '&lt;span style="font-family: Arial;font-size:'+sTooltip+';font:bold;color:#000000;"&gt;'+ sYDisplay+': ' + tooltipDataYaxis +'&lt;/span&gt;'); $('#tooltip').show(); }); $("#"+sTargetId).bind('jqplotcustomDataUnhighlight', function (ev, seriesIndex, pointIndex, data) { $('#tooltip').empty(); $('#tooltip').hide(); }); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload