The picture shown is an echarts pie chart. The drop-down list on the right can control the display and hiding of the corresponding sector area. It is the same as the function of clicking the echarts legend to control the display and hiding. How to implement it?
I have never used it, and I don’t know the environment of this project, but I can give you some ideas and make a fool of myself
When you click on the drop-down list, bind an event to the check box, and write the API exchanged by yourself. For example, click on the application sink, and then trigger the event. The application sink in the pie chart triggers the click event. If you are jq Just use trigger. Other frameworks have their own methods. The ideas are similar
ECharts
does not seem to directly provide the function you want. In fact, you can store the requested data in a variable, write the corresponding data processing method to filter the data, and re-setOptionthe processed data.
Thank you for your answers! By consulting the official documentation, this problem has been solved. Just call the
myChart.dispatchAction
method!