Información sobre herramientas de Flot Graph con datos distintos a los ejes ay

I have a Flot graph with speed on y axis and distance on x axis and tooltip (x,y). I need to show another data "date" along with the x and y in tooltip only,not on the graph. What is the best way to do it. The data in DB will be Speed|distance|date etc... So there is a relation between x,y and date.

preguntado el 01 de febrero de 12 a las 04:02

1 Respuestas

The simplest way would be to create an array of dates that is indexed identical to your data point array. In your tool tip function you can then query the date array by index to pull out the appropriate date for that point (see fiddle aquí):

$("#placeholder").bind("plothover", function (event, pos, item) {
  if (item) {
    $("#tooltip").remove();
    showTooltip(item.pageX, item.pageY,
      randomDates[item.dataIndex].toDateString()); // query by data point index
  }
  else {
    $("#tooltip").remove();
  }
});

Respondido 01 Feb 12, 22:02

Thanks a lot..I have Zoom based on x selection after zooming item.dataIndex will work ??? - paramupk

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.