// 品类销售额
drawCategorySales() {
var that = this;
let categorySalesChart = this.$echarts.init(
document.getElementById("categorySalesChart")
);
// 绘制图表
categorySalesChart.setOption({
title: {
left: "center",
text: "品类销售额",
textStyle: {
fontSize: 15
}
},
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b}: {c} ({d}%)"
},
legend: {
left:20,
bottom: 10,
//这里写a
formatter: ["{a|{name}}"].join("\n"),
icon: "circle",
itemWidth: 10,
itemHeight: 10,
textStyle: {
rich: {
//这里定义a的样式
a: {
width: 70
}
}
}
},
series: [
{
name: "访问来源",
type: "pie",
radius: ["40%", "55%"],
center: ["50%", "40%"],
data: that.pieDataList
}
]
});
},
echarts legend自定义样式固定宽度
最新推荐文章于 2025-03-18 11:26:56 发布