MissLlq removed a comment on issue #4125: 如何在legend中显示value值?
URL: 
https://github.com/apache/incubator-echarts/issues/4125#issuecomment-429699831
 
 
   用了楼上的方法,已解决。
   代码如下:
   `legend: { //控制图例
                       orient: 'vertical',
                       top: '30%',
                       right: '7px',
                       selectedMode: false,
                       formatter: (name) => {
                           const data = myChart.getOption().series[0].data
                           const getValues = data.find(v => { if (v.name === 
name) { return v.value } })
                           console.log(name + ' ' + getValues.value + '%')
                           return name + ':' + getValues.value + '%'
                       },
                       data:['直接访问','邮件营销','联盟广告','视频广告','搜索引擎'],
                   },`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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