leeoniya / uPlot

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

Solution for adding padding within the canvas itself? #940

Closed NinjaInShade closed 8 months ago

NinjaInShade commented 8 months ago

image

I have this setup going on (see screenshot), where I have some charts stacked vertically to appear as one. To make this possible, I have made the padding (the uPlot setting) 0 so they are seamlessly joined together.

The one problem I have now is that I need some padding in-between the series, and I also need the axes labels to not be cut off. Both of these would be solved if you could make the chart have padding "inside" the canvas. I could set something like paddingInside: [8, 0, 8, 0] and these issues would go away.

Thoughts? Is this possible to get into the library or to somehow implement myself somehow?

leeoniya commented 8 months ago

are you looking for something like a discrete "state" axis like in https://github.com/grafana/grafana/pull/64179 ?

you should be able to do this with a single plot.

would you mind showing an example/sketch of what you want as a final overall look?

leeoniya commented 8 months ago

let's have one discussion about this use case in https://github.com/leeoniya/uPlot/issues/939