关于网友提出的“ Echarts中legend的formatter函数怎么可以读取到data中的value值,显示出来?”问题疑问,本网通过在网上对“ Echarts中legend的formatter函数怎么可以读取到data中的value值,显示出来?”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题: Echarts中legend的formatter函数怎么可以读取到data中的value值,显示出来?描述:
legend: {
formatter: function (series) {
return series[0].name[0].value;
},
orient: 'vertical',
x: 'left',
y: 'center',
data: ['娱乐', '居家', '服饰', '餐饮', '旅游', '其他']
}
如上所示,我如何才能将Legend显示为娱乐:12345,居家:123类似的格式?
我找到了tooltip,axisLabel,Serial中的label,但是就是没有legend中的,求大神告知。。。
解决方案1:
formatter: "{name}"