You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/08/22 17:36:03 UTC

[GitHub] [echarts] locinus edited a comment on issue #14835: Lines and mark areas disappear during zooming

locinus edited a comment on issue #14835:
URL: https://github.com/apache/echarts/issues/14835#issuecomment-903303711


   I indeed believe this issue still exists: markLines defined by two points disappear when zooming in, as at least one of the points is out of the zoomed window, and even with the filterMode: 'none' option.
   
   A possible workaround could be to hook on the 'datazoom' event and save the zoom state:
   
   const zoomState = {};
   
   ```
   echartsInstance.on('datazoom', (event) => {
     const option = echartsInstance.getOption();
     if(option.dataZoom && Array.isArray(option.dataZoom) && option.dataZoom.length > 0) {
       zoomState.startValue = option.dataZoom[0].startValue;
       zoomState.endValue = option.dataZoom[0].endValue;
     }
   });
   ```
   
   and then proceed to recalculate the chart's options, using the zoomState.startValue and zoomState.endValue as the boundaries of the markLines (I would add +1 to the startValue and -1 to the endValue to make sure we're within the zoomed window). Not ideal, but does the job.


-- 
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