leeoniya / uPlot

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

difference between range and min/max #877

Closed kitty7c6 closed 7 months ago

kitty7c6 commented 7 months ago

Hello, I'm new in uPlot, and I have a few not understanding situations about zoom, range and min/max. I have a chart with dynamically added points and scales options: scales: { x: { time: false, }, y: { range: [CONST_MIN, CONST_MAX], } }. And button_ChScale to change x-y scales min/max u.setScale("x", {min: ch_Xmin, max: ch_Xmax}); u.setScale("y", {min: ch1_Ymin, max: ch1_Ymax});.

  1. When points not adding, I can change min/max scale with button_ChScale and can zooming by mouse, but with doubleclick changing scale backed to range.
  2. When points are adding, I can't zoom or change min/max. With every new point scale backed to range.

So min/max almost equal zooming, and range != min/max? Range is static options, wich sets only with chart creating, and I can't change it during later work?

leeoniya commented 7 months ago

this feels like the same conversation as #878. let's discuss there.