Aditya Sharma
Aditya Sharma

Reputation: 73

How to see previous graph after drill down in echarts?

I am trying to see the previous graph after drill down in echarts bargraph. I have changed the setOption after the user clicks the bar series.

User click on the bar series and then the graph will change. I want to visit the previous graph before clicking.

 bargraph.on('click',function(params){
        if(params.componentType == 'series'&& params.name =='shirt')
        setInterval(function(){
                bargraph.setOption(baroption2)
            },200);
    })    

Upvotes: 1

Views: 464

Answers (1)

Clocher Zhong
Clocher Zhong

Reputation: 2456

You should store the previous graph's option like previousOption,

When you want to see the previous graph, use setOption(previousOption).

Now you can see the previous graph again.

Upvotes: 1

Related Questions