echarts柱状体改变颜色 同时对应legend
1.echarts改变柱状图的颜色,每个柱状图显示不同的颜色
写的时候一直x轴和柱状图对不齐,当把x轴的data删除后,就没问题了
endchartes() {
let chart4 = this.$echarts.init(
document.getElementById("end_zz_echartes"),
"light"
);
let option4 = {
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
},
legend: {
orient: "vertical",
top: "25%",
x: "70%", //图例位置,设置right发现图例和文字位置反了,设置一个数值就好了
y: "center", //延Y轴居中
},
grid: {
left: "5%",
right: "35%",
bottom: "5%",
containLabel: true,
},
xAxis: [
{
axisTick:</