leeoniya / uPlot

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

stroke-only bars disappear at narrow bar widths #880

Closed leeoniya closed 7 months ago

leeoniya commented 7 months ago

https://github.com/leeoniya/uPlot/blob/c629511d9c2d6dbba5bc799c823b120ac55e722a/src/paths/bars.js#L106-L107 https://github.com/leeoniya/uPlot/blob/c629511d9c2d6dbba5bc799c823b120ac55e722a/src/paths/bars.js#L146-L147

when setting the strokeWidth to 0, it should switch the fill color to use the stroke color. since the actual filling/stroking is done in the caller, the pathBuilder needs to return an additional flag (something like STROKE_AS_FILL)

setting fill opacity to 0 here shows the issue:

https://github.com/leeoniya/uPlot/blob/c629511d9c2d6dbba5bc799c823b120ac55e722a/demos/high-low-bands.html#L670-L691