I am developing an application using jquery mobile and flot charts.
In That i have 3 tabs.
I am displaying my chart on the first tab.But the weird thing which is happening is that if i plot the graph in the first tab then my labels get misplaced.Here is the fiddle jsFiddle code
But if suppose i plot my graph in second or third tab then my charts are correct. My code is here jsfiddle code
why is this happening?
I got it.
I just need to change
plot.Offset()toplot.getPlotOffset()Then its working correctly.
offset() —
Returns the offset of the plotting area inside the grid relative
to the document, useful for instance for calculating mouse
positions (event.pageX/Y minus this offset is the pixel position
inside the plot).
getPlotOffset() —
Gets the offset that the grid has within the canvas as an object
with distances from the canvas edges as “left”, “right”, “top”,
“bottom”. I.e., if you draw a circle on the canvas with the center
placed at (left, top), its center will be at the top-most, left
corner of the grid.