I got the Flot-created graph. What I wanted to acomplish is to get some kind of information when user moves the mouse over it - best would be to show the data (from x and y axis) in some kind of javascript popup.
It's probably trivial question, but I can't figure it out...
Right now my javascript looks like this:
<script id="source" language="javascript" type="text/javascript">
$(function () {
var data = [[1251756000000, 122.68],[1251842400000, 122.68],[1251928800000, 125.13],[1252015200000, 112.62],[1252101600000, 122.76]]
$.plot($("#graph_placeholder"), [ data ], {
xaxis: { mode: "time", minTickSize: [1, "day"], timeformat : "%y/%m/%d", },
lines: { show: true },
points: { show: false },
} );
});
</script>
So best would be to get the x: 1251756000000 y: 122.68
when hovering the point (x: 1251756000000, y: any). Or even have the x
value formatted as defined in the timeformat
(2009/11/14).