//显示图标
var Chart = echarts.init(document.getElementById("main"));
var option = {
title: {
text: '分布统计'
},
tooltip : {
trigger: "axis",
axisPointer : { // 坐标轴信息指示器,坐标轴触发有效,可以看到数据信息
type : "shadow" // 默认为直线,可选为:"line" | "shadow"
}
},
color:["#7CCD7C","#436EEE","#8E388E","#4B0082","#00CED1"],
legend: {
data:['签订','执行','结束','收款','付款']
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true
},
xAxis : [
{
type : "category",
data :legendName
}
],
yAxis : [
{
type : "value"
}
],
series : [
{
name:"签订",
type:"bar",
stack: '签订',
itemStyle : { normal: {label : {show: true, position: 'top'}}},
data:qianDing
},
{
name:"执行",
type:"bar",
stack: '执行',
itemStyle : { normal: {label : {show: true, position: 'top'}}},
data:zhiXing
},
{
name:"结束",
type:"bar",
stack: '结束',
itemStyle : { normal: {label : {show: true, position: 'top'}}},
data:jieShu
},
{
name:"收款",
type:"bar",
stack: '收款',
itemStyle : { normal: {label : {show: true, position: 'top'}}},
data:shouKuan
},
{
name:"付款",
type:"bar",
stack: '付款',
itemStyle : { normal: {label : {show: true, position: 'top'}}},
data:fuKuan
}
]
};
Chart.setOption(option);
echarts生成条形统计图【随记】
最新推荐文章于 2024-07-05 17:19:30 发布