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/10/08 06:10:25 UTC

[GitHub] [echarts] Ovilia edited a comment on issue #15825: Dynamic showSymbol based on number of data points shown in the zoom

Ovilia edited a comment on issue #15825:
URL: https://github.com/apache/echarts/issues/15825#issuecomment-938371011


   You can listen to data zoom event and do something like
   
   ```
   myChart.on('datazoom', function (param) {
     const percent = param.end - param.start; // using percent to detect the level of data zoomed
     if (percent > 10 && option.series[0].symbol !== 'none') {
       option.series[0].symbol = 'none';
       myChart.setOption(option);
     }
     else if (percent <= 10 && option.series[0].symbol === 'none') {
       option.series[0].symbol = function (value, param) {
         // show symbol every 5 data
         return param.dataIndex % 5 === 0 ? 'emptyCircle' : 'none';
       };
       myChart.setOption(option);
     }
   })
   ```
   
   Hope it helps.


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