现在有一个需求是做出如图中的效果,
我自己用echart做了一下,目前只能做成下面这样,
代码如下:
Documentbody,
html {
height: 100%
}
body {
background: rgb(16, 158, 226);
}
var JSONdata = [{ key: "女性", val: "298" }, { key: "少数民族", val: "89" }, { key: "非共产党员", val: "43" }];
var myChart = echarts.init(document.getElementById("content"));
option = {
color: ['rgb(79,129,189)'],
yAxis: {
type: 'category',
data: JSONdata.map(x => (x.key)),
axisLabel: {
show: true,
textStyle: {
color: '#000',
}
}
},
xAxis: {
type: 'value',
color: "#000",
axisLabel: {
show: true,
textStyle: {
color: '#000'
}
}
},
series: [{
data: JSONdata.map(x => (x.val)),
type: 'bar'
}],
label: {
show: true,
position: "inside",
color: "#000"
},
};
myChart.setOption(option);
myChart.on('click', function (params) {
alert(params.dataIndex);
});
请问中间表格的背景颜色怎么设置成白色?看了好久文档也没找到,谢谢SF的echart大神T_T