X: Y:

Mouse Events

To receive "mtag" events, use the addListener() method:


plot.addListener("mtag", callback);
			

The callback will be called whenever an "mtag" is emitted; the event will always include an 'x' and 'y'.


function callback (event) {
    $("#mtagx").html("X: " + event.x.toFixed(8));
	$("#mtagy").html("Y: " + event.y.toFixed(8));
};
			

By default, clicking on the plot will trigger an 'mtag'. Try clicking around and see the values. You can change the 'mtag' mode via Cntrls... item under the main-menu (middle-click). You can also use the SigPlot.settings call to change the modes:


plot.change_settings( {xcnt: "leftmouse"});  // mtag on left click
plot.change_settings( {xcnt: "continuous"}); // mtag on mouse movement
plot.change_settings( {xcnt: "disable"});    // disable the mtag (i.e. no events)