ECharts confidence bands in legend as one item

17 Views Asked by At

I counstructed ECharts confidence bands around the main series, similar to example. However, in the example there is no legend. I use legend and I want to show main data as one legend item and confidence band as another. Since confidence band is in fact realized as two series stacked one on another, they both appear in legend and user can enable or disable one or another, which is not desired behaviour. Both confidence band series should appear as one item in legend and clicking on symbol in legend should show/hide both of them in the same time.

One solution comes to mind, to show in legend only one of series and use legendselectchanged event to catch clicking on it and hide/show both series together, but it feels a bit hacky, perhaps there is better solution?

0

There are 0 best solutions below