option = { tooltip: { trigger: "axis", axisPointer: { // Use axis to trigger tooltip type: "shadow", // 'shadow' as default; can also be 'line' or 'shadow' }, }, legend: { top: 20, left: 140, textStyle: { color: "#000", // 文本颜色 }, }, grid: { left: "3%", right: "6%", bottom: "3%", containLabel: true, }, xAxis: { type: "value", axisLabel: { // x轴刻度标签样式 textStyle: { color: "#000", // 设置x轴刻度字体颜色为灰色 }, }, splitLine: { lineStyle: { color: "#ccc", type: "dashed", }, }, }, yAxis: { type: "category", data: ['a','b','c'], axisLabel: { // y轴刻度标签样式 textStyle: { color: "#000", // 设置y轴刻度字体颜色为深青色 }, }, }, series: [ { name: "正面", type: "bar", barWidth: "40%", stack: "total", emphasis: { focus: "series", }, data: [1,2,3], itemStyle: { color: "#5CAF85", // 自定义颜色 }, }, { name: "中性", type: "bar", stack: "total", emphasis: { focus: "series", }, data: [4,5,6], itemStyle: { color: "#2A86C6", // 自定义颜色 }, }, { name: "负面", type: "bar", stack: "total", emphasis: { focus: "series", }, data: [7,8,9], itemStyle: { color: "#E56A6A", // 自定义颜色 }, } ], }