How to set Datazoom for all axis on SingleAxis in Baidu's echarts?

1.1k views Asked by At

Is it possible to set an 'inside' Datazoom for each axis on the SingleAxis chart?

I'm using the following example but adding dataZoom object only works for the first axis. https://echarts.apache.org/examples/en/editor.html?c=scatter-single-axis

I used this dataZoom : const options = {
     ...
    dataZoom: [{
        type: 'inside',
    },
     {
        type: 'inside',
     }],
     ...
}

2

There are 2 answers

0
joohong89 On BEST ANSWER

For Angular folks using ngx-echart, the accepted did not work for me .'

Using xAxisIndex with array works in my case.

dataZoom: [
    {
      type: 'slider',
      bottom: 0,
      xAxisIndex: [0,1,2,3,4]
    }];
0
Sergey Fedorov On

Yes, just pass to slider attribute singleAxisIndex array of each axis index.

dataZoom: [{
  type: 'slider',
  //...
  singleAxisIndex: [0,1,2,3,4,5,6]
  //...
}