Rahul Yadav
Rahul Yadav

Reputation: 3207

Echarts dataZoom slider handleIcon shape not working

In the echarts docs at https://echarts.apache.org/en/option.html#dataZoom-slider.handleIcon the handle icon for data zoom slider has shape options like "circle", "rectangle" etc.

However these shapes doesn't seem to work. If we specify dataZoom: [{ handleIcon: "circle" }] the handle icon just disappears.

Is the implementation for this API still pending or else?

Upvotes: 0

Views: 1112

Answers (1)

Sergey Fedorov
Sergey Fedorov

Reputation: 4430

You misinterpreted the documentation. The method handleIcon expects a string of path but not some shape identifier. Please take a look at the tests where you can found how to use this method.

However, you can define the icons outside of the chart configuration and use inside with identifier:

var icons = {
  circle: 'M17.498,11.697c...',
  square: 'M17.498,11.697c...'
}

var option = {
  //...
  dataZoom: [{ handleIcon: icons['circle'] }]
}

Upvotes: 1

Related Questions