uPlot icon indicating copy to clipboard operation
uPlot copied to clipboard

zIndex for series

Open zefirka opened this issue 5 years ago • 3 comments

Hello. First of all - thank you for this amazing library.

I have a question about grid and area series.

  • Is there any way to set grid z-index? Let's suppose that I will change fill opacity to 1 in this demo. Then grid will be hidden behind the areas. Can I make grid to be shown over all series?

And second question arises from previous:

  • Is there any way to set z-index for series?

zefirka avatar Dec 01 '20 15:12 zefirka

hey @zefirka

there isn't currently a way to set the grid zindex. it should be pretty easy to add an option for executing the axes & grid draw after the series draw.

however, an arbitrary z-index for the grid (to render it between 2 series) is too niche and would be difficult to implement, so this won't happen.

series are drawn in their defined order, so re-arranging them in your opts & data is a work-around for now. a custom series z-index would also be a useful & simple addition, it can also help with hover-focusing a series which currently relies on opacity manipulation only.

leeoniya avatar Dec 02 '20 09:12 leeoniya

Hi, @leeoniya

Thanks for response.

I'm agree about custom zIndex for grid, it seems that it should be single option for grid to be on top of series or not. If you have not plans to add this option in near future then I can take it to myself and send PR.

And thank you for advice how to reorder series.

zefirka avatar Dec 02 '20 09:12 zefirka

Submitted #391

zefirka avatar Dec 05 '20 18:12 zefirka