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/04 20:30:45 UTC

[GitHub] [echarts] dirslashls opened a new issue #15825: Dynamic showSymbol based on number of data points shown in the zoom

dirslashls opened a new issue #15825:
URL: https://github.com/apache/echarts/issues/15825


   ### What problem does this feature solve?
   Line series allows showing symbols for the data points but if there are too many data points, it is usually better to disable this. However, when a line chart is drawn using time axis which allows zooming, it would be best to be able to dynamically show or hide the symbols based on the zoom level and the current number of points visible in the viewport.
   
   ### What does the proposed API look like?
   showSymbol option currently is a boolean. It could additionally be a function call with access to current number of points being displayed based on zoom. The function can decide whether to show the symbols or not. If there are other better ways to decide this without asking the application, that would be great to with a simple option of 'auto' that automatically determines when to show and when to hide the symbols.
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


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


[GitHub] [echarts] echarts-bot[bot] commented on issue #15825: Dynamic showSymbol based on number of data points shown in the zoom

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #15825:
URL: https://github.com/apache/echarts/issues/15825#issuecomment-933832154


   Hi! We've received your issue and please be patient to get responded. 🎉
   The average response time is expected to be within one day for weekdays.
   
   In the meanwhile, please make sure that it contains **a minimum reproducible demo** and necessary **images** to illustrate. Otherwise, our committers will ask you to do so.
   
   *A minimum reproducible demo* should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.
   
   You may also check out the [API](http://echarts.apache.org/api.html) and [chart option](http://echarts.apache.org/option.html) to get the answer.
   
   If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org. Please attach the issue link if it's a technical question.
   
   If you are interested in the project, you may also subscribe to our [mailing list](https://echarts.apache.org/en/maillist.html).
   
   Have a nice day! 🍵


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


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

Posted by GitBox <gi...@apache.org>.
Ovilia commented 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;
     if (percent > 10 && option.series[0].symbol !== 'none') {
       option.series[0].symbol = 'none';
       myChart.setOption(option);
     }
     else if (percent <= 10 && option.series[0].symbol !== 'emptyCircle') {
       option.series[0].symbol = 'emptyCircle';
       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


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

Posted by GitBox <gi...@apache.org>.
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


[GitHub] [echarts] dirslashls commented on issue #15825: Dynamic showSymbol based on number of data points shown in the zoom

Posted by GitBox <gi...@apache.org>.
dirslashls commented on issue #15825:
URL: https://github.com/apache/echarts/issues/15825#issuecomment-938400719


   Thanks @Ovilia , this looks promising. My charts are complex with multiple series and potentially some zoomable and some not and I can't hard-code the logic. I see that the param has a dataZoomId that looks like "\u0000series\u00000\u00000". I don't see the dataZoom index in the option being passed. How can I tell which dataZoom is being referred to from the dataZoomId?


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


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

Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #15825:
URL: https://github.com/apache/echarts/issues/15825#issuecomment-938346477


   [symbol](https://echarts.apache.org/en/option.html#series-line.symbol) can be a callback function so that you can decide which items to display.


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


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

Posted by GitBox <gi...@apache.org>.
Ovilia edited a comment on issue #15825:
URL: https://github.com/apache/echarts/issues/15825#issuecomment-938459348


   This is the default dataZoomId if you did not set one. You can set `dataZoom.id` in the option to be something like `'aaa'` and should get `'aaa'` as `dataZoomId` in the event callback.


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


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

Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #15825:
URL: https://github.com/apache/echarts/issues/15825#issuecomment-938459348


   This is the default dataZoomId if you did not set one. You can set `dataZoom.id` to be something like `'aaa'` and should get `'aaa'` as `dataZoomId` in the event callback.


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


[GitHub] [echarts] dirslashls commented on issue #15825: Dynamic showSymbol based on number of data points shown in the zoom

Posted by GitBox <gi...@apache.org>.
dirslashls commented on issue #15825:
URL: https://github.com/apache/echarts/issues/15825#issuecomment-938355693


   Thanks for the suggestion @Ovilia . Unfortunately my issue is not that I want different symbols. If there are lot of data points, I want to hide the symbols. Say, I am seeing some time-series data for the whole year, I just want to see a line without symbol on each data point. But when the user zooms to a smaller time period, then the number of data points are going to reduce at which point I would like to be able to show the symbols. One of the reasons for this is that I want the user to be able to click the symbol to take other actions. At the moment there is #13637 where click actions are not triggered on a line unless a symbols is displayed.


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


[GitHub] [echarts] dirslashls commented on issue #15825: Dynamic showSymbol based on number of data points shown in the zoom

Posted by GitBox <gi...@apache.org>.
dirslashls commented on issue #15825:
URL: https://github.com/apache/echarts/issues/15825#issuecomment-938751779


   Thanks @Ovilia , I got this working with all your help.


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


[GitHub] [echarts] dirslashls closed issue #15825: Dynamic showSymbol based on number of data points shown in the zoom

Posted by GitBox <gi...@apache.org>.
dirslashls closed issue #15825:
URL: https://github.com/apache/echarts/issues/15825


   


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