Search code examples
javascriptvisualizationecharts

Grouped Series in Apache Echarts


I am using the JavaScript plot library Echats, and I reached into the following issue. I want to represent some values and their regression together. That means that when I click the respective legend, both time series are shown. I got that by using the markLine Echarts component. Currently, it leads to the picture plot: enter image description here

Nevertheless, due to this open incident, when you zoom the data, the regression line disappears. As a workaround, I was thinking about just creating 2 regular series, but for the moment, I did not get any way to show both of them when you click the legend (I don´t want the regression to be in the legend, but just show up respectively for each of the values there).

Is there anyway to use a sort of nested series structure? Any other potential solution?


Solution

  • For the moment, there is no way to do that in Echarts.

    Using React, I used a workaround by creating a state and saving there the selected legend. By passing this parameter to the Echart component, you can play with which time series will be shown.