leeoniya / uPlot

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

Solution for adding padding within the canvas itself? #940

Closed NinjaInShade closed 1 month ago

NinjaInShade commented 1 month 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 1 month 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 1 month ago

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