3

I want to check node is Expand or Collapse on click.

I checked click event but did not get any flag for Collapse or Expand

    chart.on('click', e => {
      // want to access here 
    })

Aashish Chakravarty
  • 373
  • 1
  • 5
  • 14

1 Answers1

1

chart.on('click', func(params) {})

The params provide access to the collapsed flag.

I didn't have any luck using this outside of the scope of chart.setOption().

Since it's inside, you need to add "this" as the context for access-

chart.on('click', func(params){}, this)

Read more here- https://echarts.apache.org/en/api.html#echartsInstance.on

Neha Soni
  • 3,935
  • 2
  • 10
  • 32
Leon Chaus
  • 11
  • 2