Anonymous avatar Anonymous committed 0358d1c

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

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);
         }
     };
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.