Commits

Anonymous committed 0358d1c

Only synchronize one cursor between two charts (the syncCursor no longuer synchronize the two charts at the same time).

  • Participants
  • Parent commits 971bf81

Comments (0)

Files changed (1)

src/plugins/jqplot.cursor.js

 	// Function used to synchronize cursor between two chart.
     // This method was added to jqplot to add this feature.
     $.jqplot.Cursor.syncCursor = function(firstPlot, secondPlot) {
-    	
-        secondPlot.target.bind('jqplotMouseMove', mouseMoveFirstPlot);
-        secondPlot.target.bind('jqplotMouseEnter', mouseEnterFirstPlot);
-        secondPlot.target.bind('jqplotMouseLeave', mouseLeaveFirstPlot);
-        
         firstPlot.target.bind('jqplotMouseMove', mouseMoveSecondPlot);
         firstPlot.target.bind('jqplotMouseEnter', mouseEnterSecondPlot);
         firstPlot.target.bind('jqplotMouseLeave', mouseLeaveSecondPlot);
         
-        function mouseMoveFirstPlot(ev, gridPos, dataPos, neighbor, plot) {
-        	handleMouseMove(ev, gridPos, dataPos, neighbor, firstPlot);
-        }
-        
-        function mouseEnterFirstPlot(ev, gridPos, dataPos, neighbor, plot) {
-        	handleMouseEnter(ev, gridPos, dataPos, neighbor, firstPlot);
-        }
-
-        function mouseLeaveFirstPlot(ev, gridPos, dataPos, neighbor, plot) {
-        	handleMouseLeave(ev, gridPos, dataPos, neighbor, firstPlot);
-        }
-        
         function mouseMoveSecondPlot(ev, gridPos, dataPos, neighbor, plot) {
+            gridPos.x = secondPlot.axes.xaxis.series_u2p(dataPos.xaxis);
         	handleMouseMove(ev, gridPos, dataPos, neighbor, secondPlot);
         }
 
         function mouseEnterSecondPlot(ev, gridPos, dataPos, neighbor, plot) {
+            gridPos.x = secondPlot.axes.xaxis.series_u2p(dataPos.xaxis);
         	handleMouseEnter(ev, gridPos, dataPos, neighbor, secondPlot);
         }
 
         function mouseLeaveSecondPlot(ev, gridPos, dataPos, neighbor, plot) {
+            gridPos.x = secondPlot.axes.xaxis.series_u2p(dataPos.xaxis);
         	handleMouseLeave(ev, gridPos, dataPos, neighbor, secondPlot);
         }
     };