Changing x axis title on panning - Flot -


is quite new to Flot, and wondering if there is a way to convert the X-axis title into a pan.

Each point on the x-axis indicates a date, but I only want to show the number of days, and displaying the title of the X axis is the month - as if the user will show it from 1 to 31 days, Then when they pan in day 1 - 28, then it will show February - and so on.

First of all, is it possible, and if so, how?

Thank you. / P>

Yes, you can do this by using the plotpan event. Do something like this:

  $ ('# placeholder'). Dam ("plot", function (event, plot) {var xAxis = plot.getAxes () .xaxis; // build this function format of your values ​​(timestamp ...) var monthName = getMonthNameFromMaxValue (xAxis.max); / / Depends on the plugin used for your axis label (see link below) setAxisLabel (monthName);});  


Comments