leeoniya / uPlot

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

all-null series incorrectly accumulate log scales to min: 1, max: 10 #910

Closed leeoniya closed 3 months ago

leeoniya commented 4 months ago

need to figure out how to set fallback values after accumulating min/max from all series, rather than per-series.

leeoniya commented 4 months ago

https://github.com/leeoniya/uPlot/blob/28fb4382f978411428ab9b1eba3bb08f11420ab7/src/utils.js#L81-L84

leeoniya commented 4 months ago

https://jsfiddle.net/q73vxrpe/

let data = [
  [0, 1, 2],
  [100, 200, 1000],
  [null, null, null]
];

const opts = {
  width: 800,
  height: 400,
  scales: {
    x: {
      time: false,
    },
    y: {
      distr: 3
    }
  },
  series: [
    {},
    {
      stroke: "red"
    },
    {
      stroke: "blue"
    },
  ],
};

let u = new uPlot(opts, data, document.body);

image