leeoniya / uPlot

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

series without a stroke cause bugs in point rendering and hover points #874

Open leeoniya opened 8 months ago

leeoniya commented 8 months ago

pretty surprising that this has never come up.

the logic for setting default point fills and stokes is actually quite complicated, given that it has to account for various combos of missing settings, and that point fills come from series strokes unless explicitly defined otherwise.

image

you can still get it working by being explicit. it's just the defaults/fallbacks that are not working.

series: [
  {},
  {
    // stroke: "red",
    fill: "rgba(255,0,0,0.1)",
    value: fmtVal,
    points: {
      stroke: "red",
    }
  },
  {
    // stroke: "green",
    fill: "rgba(0,255,0,0.1)",
    value: fmtVal,
    points: {
      stroke: "green",
    }
  },
  {
    // stroke: "blue",
    fill: "rgba(0,0,255,0.1)",
    value: fmtVal,
    points: {
      stroke: "blue",
    }
  },
],

image