leeoniya / uPlot

📈 A small, fast chart for time series, lines, areas, ohlc & bars
MIT License
8.51k stars 371 forks source link

How set equal axis aspect ratio #949

Open veliteq opened 1 week ago

veliteq commented 1 week ago

@leeoniya Hi, thanks for this amazing library.

How to set and adjust plots with equal axis aspect ratios?

sphx_glr_axis_equal_demo_001

leeoniya commented 1 week ago

each scale/axis and plot width/height can be set independently, so while this is possible, how difficult this will be depends on what other uplot features you need to continue working (zoom, resize, legend toggle, etc.). you cannot have a fixed aspect ratio and still have everything work as it does; compromises have to be made somewhere.

you will need to describe your specific requirements and provide example data to get further advice.

veliteq commented 1 week ago

provide example data to get further advice

https://jsfiddle.net/K_Korovin/b5rfxutg/62/

The dot shape should always be a square when zoom, resize and mousewheel zoom.

Also in this example, for some reason, the data on the right side of the square is not displayed.