echarts生成条形统计图【随记】

//显示图标
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);
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值