Fleet: How to keep the x and y axes at the same scale?

I want to plot on a standard Cartesian plane, so 1 unit on the x axis is the same length as a unit on the y axis. I am also using a navigation plugin for zoom and pan. Do I have such a limitation? can't find anything about it in the Flot api.

Thank,

+3


source to share


1 answer


I had to do something like this and this was my first test: fiddle

The main thing is that you set the max values ​​for the axis to the same ratio as the width and height of your placeholder separator:



options.xaxes[0].max = options.yaxes[0].max * $('#ph').width() / $('#ph').height();
$.plot($('#ph'), data, options);

      

+1


source







All Articles