syampillai / SOCharts

A wrapper around the "echarts" JavaScript library to use it as a Vaadin component.
Apache License 2.0
27 stars 11 forks source link

Support the horizontal-only zoom #13

Closed vilmosnagy closed 1 year ago

vilmosnagy commented 1 year ago

See this chart: https://echarts.apache.org/examples/en/editor.html?c=area-time-axis

I cannot zoom on the vertical axis, only on the horizontal one.

As far as I understand this is the JS descriptor for it:

  toolbox: {
    feature: {
      dataZoom: {
        yAxisIndex: 'none'
      },
      restore: {},
      saveAsImage: {}
    }
  },
vilmosnagy commented 1 year ago

Do you have any suggestion how to implement this? If you could give me a general direction I'm willing to submit a PR in the next weeks.

See the docs on the JS API: https://echarts.apache.org/en/option.html#dataZoom-inside.xAxisIndex

syampillai commented 1 year ago

This is implemented and is available in the latest version. Please have a look at the API for Toolbox.Zoom class.

vilmosnagy commented 1 year ago

Thanks, I've found it <3