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 2022/04/21 04:08:14 UTC

[GitHub] [echarts] MasterOdin opened a new issue, #16923: [Feature] Render inner and outer labels for pie chart

MasterOdin opened a new issue, #16923:
URL: https://github.com/apache/echarts/issues/16923

   ### What problem does this feature solve?
   
   For a pie chart, I'd like to be able to show labels both on the inside of each slice (the slice value), as well on the exterior (the slice label), like so:
   
   <img width="971" alt="Screen Shot 2022-04-12 at 6 05 03 AM" src="https://user-images.githubusercontent.com/1845314/164369781-428dee10-e3a7-4e30-b2e2-122eaeb444a8.png">
   
   While the slice value can be captured within the tooltip and the slice label shown (or vice versa), it would still be nice to be able to show both so that a user can quickly at a glance till the information without having to hover, or coordinate colors to the legend.
   
   ### What does the proposed API look like?
   
   When looking at the docs, I assumed that defining the `label` value at the top of `series`, and then a `label` per `data` would get me what I wanted, like so:
   
   ```
     const option = {
       legend: {
         show: chartFormatting.legendEnabled,
         left: 'right',
         orient: 'vertical',
       },
       series: {
         data: data.map((datum) => ({
           ...datum,
           label: {
             show: true,
             formatter: (params) => params.value,
             position: 'inside',
           },
           name: datum.label,
         })),
         label: {
           show: true,
           position: 'outside',
         },
         type: 'pie',
       },
     };
   ```
   
   However, it seems like only one of the labels are applied.
   
   Alternatively, being able to pass an array to `label` would also possibly work?


-- 
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.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] MasterOdin commented on issue #16923: [Feature] Render inner and outer labels for pie chart

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

   When using multiple pie series layered on top of each other, is there a way to get the `legend.selectedMode` setting to work appropriately where I want to only show one of the series within the legend, but clicking on that item would disable the data value in both series.


-- 
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 #16923: [Feature] Render inner and outer labels for pie chart

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

   ECharts does not support multiple labels for a single item by now. It seems to need a lot of changes on the architecture level. The best way to do so is use two pie series and use labels with different positions. You may need to set one series to be silent so that the mouse will always hovers on one of them.


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