You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "unitrongroup-ir (via GitHub)" <gi...@apache.org> on 2026/10/06 20:19:58 UTC

Re: [I] [Feature] Allow drag-to-zoom even when toolbox.feature.dataZoom.show is false [echarts]

unitrongroup-ir commented on issue #21367:
URL: https://github.com/apache/echarts/issues/21367#issuecomment-6024706082

   +1, we needed the same thing (Plotly-like drag zoom with our own zoom buttons outside the chart).
   
   In case it helps someone until this is there: we keep the toolbox but make it invisible with `itemSize: 0`. With `show: false` the feature isn't rendered at all and dragging does nothing. Then we switch the select mode on ourselves:
   
   ```js
   toolbox: {
     show: true,
     itemSize: 0,
     showTitle: false,
     feature: { dataZoom: { yAxisIndex: 'none', filterMode: 'none' } }
   }
   ```
   
   ```js
   chart.dispatchAction({ type: 'takeGlobalCursor', key: 'dataZoomSelect', dataZoomSelectActive: true });
   ```
   
   After `setOption(option, { notMerge: true })` the select mode is off again, so we dispatch it after every update. Dispatch it with `dataZoomSelectActive: false` before the `setOption` too, otherwise you run into #21661.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org