alex2wong commented on issue #12080: Donut chart with centered dynamic text
URL: 
https://github.com/apache/incubator-echarts/issues/12080#issuecomment-576314424
 
 
   
   > @alex2wong I want custom dynamic text at center.
   
   sure, the label could be customized by string formatter or callback function 
based on data 
   
   ```
   label: {
       normal: {
           show: false,
           position: 'center',
           formatter: function(params) {  // callback function 
                           if (params.dataIndex === 0) {
                               return params.data[params.dataIndex];
                           } else { return '' }
                       }
       },
       emphasis: {
           show: true,
           formatter: `customized {a}\n {b}: {c}`  // string formatter
       }
   },
   ```
   
   please refer to doc: 
https://echarts.apache.org/en/option.html#series-pie.label.formatter 
   and try in this demo: 
https://echarts.apache.org/examples/zh/editor.html?c=pie-doughnut

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to