在做项目饼状图的时候使用echart组件,
tooltip: {
trigger: ‘item’,
backgroundColor: ‘rgba(50,50,50,0.6)’,
formatter: ‘{a}
{b} : {c} ({d}%)’
}
其中在取值的时候页面显示出现了问题{c}取到的是[object object],不显示数据。
解决办法
将formatter变成函数
formatter: function (params) {
//console.log(params)
return params.value.1122+ ‘: ’ + params.value.2233+ ’ (’ + params.percent + ‘%)’
}
根据自己传的参数params来确定自己想要的结果;
不喜勿喷,欢迎大佬提出宝贵建议,不懂加vechart组件饼状图farmatter使用函数取到值

相关文章:

  • 2022-12-23
  • 2021-06-18
  • 2021-12-25
  • 2021-11-07
  • 2022-12-23
  • 2021-06-30
  • 2021-09-15
猜你喜欢
  • 2022-12-23
  • 2021-08-01
  • 2021-07-29
  • 2021-06-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案