Domanda

using http://www.flotcharts.org/ to realize a complex scatterplot graphic with zoom/pan functionalities, i would like to set mouse position at specific coordinates (by example: when doing a zoom in, I would like that cursor would positioned at the center of canvass).

It ssem this function doesn't work:

  function setMousePosition(pos) {

  var x = pos.x;
  var y = pos.y;

  var pointX = ( Math.floor(plot.offset().left + plot.p2c(pos).left) );
  var pointY = ( Math.floor(plot.offset().top + plot.p2c(pos).top) );

 $("#placeholder").mouseXPos( pointX ).`mouseYPos`( pointY );

About mouseXPos and mouseYPos, firebug say: TypeError: placeholder.mouseXPos is not a function

So my question is: there is a way in javascript or jquery to set mouse coordinates inside a graphic area ?

È stato utile?

Soluzione 2

There is no any mechanism to place a cusror to specific position programmatically in Javascript

Altri suggerimenti

The mouse position cannot be set/changed via JavaScript.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top