echarts横向柱状图分享

效果图

在这里插入图片描述

突出点

(稍后补充)

代码

option = {
    backgroundColor:'rgba( 9, 12, 32, .5)',
    tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                }
            },
            legend: {
                data: [
                    {
                        name: '设备达标',
                        textStyle: {
                            color: '#50B6FA'
                        },
                        itemStyle: {
                            color: '#50B6FA'
                        },
                    }, 
                    {
                        name: '数据达标',
                        textStyle: {
                            color: '#50FAAB'
                        },
                        itemStyle: {
                            color: '#50FAAB'
                        },
                    }
                ],
                left: '66',
                itemWidth: 8,             // 图例图形宽度
                itemHeight: 8,
                padding: [
                    15,  // 上
                    0, // 右
                    15,  // 下
                    0, // 左
                ],
                textStyle: {
                    fontFamily: 'PingFangSC-Regular',
                    fontSize: 14,
                    color: '#50B6FA',
                    lineHeight: 20,
                    fontWeight: '400',
                },
                
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis: {
                type: 'value',
                axisTick: {
                    show: true,
                    inside: true,
                    alignWithLable: true
                },
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: "#6A97FF",
                    },
                },
                axisLabel: {
                    color: "#D0DEFF",
                    fontSize: 14,
                    fontFamily: "PingFangSC-Regular",
                    align: "center",
                    fontWeight: "400",
                },
                boundaryGap: [0, 0.01],
                splitLine: {//x轴分割线
                    show: false,
                },
            },
            yAxis: {
                type: 'category',
                axisTick: {
                    show: false,
                },
                axisLabel: {
                    color: "#D0DEFF",
                    fontSize: 14,
                    fontFamily: "PingFangSC-Regular",
                    align: "right",
                    fontWeight: "400",
                },
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: "#6A97FF",
                    },
                },
                data: ['南京', '徐州', '扬州', '常州', '连云港', '盐城', '宿迁',
                    '泰州', '南通', '镇江', '苏州', '无锡', '淮安']
            },
            series: [
                {
                    name: '设备达标',
                    type: 'bar',
                    color: '#50B6FA',
                    data: [18, 29, 34, 170, 134,803, 289, 170, 144,234, 100, 134, 63],
                    itemStyle: {
                        normal: {
                            color: new echarts.graphic.LinearGradient(
                            1,
                            0,
                            0,
                            0,
                            [
                                {
                                offset: 0,
                                color: 'rgba(80, 182, 250, 1)'
                                },
                                {
                                offset: 1,
                                color: 'rgba(80, 182, 250, 0)'
                                }
                            ],
                            false
                            )
                        }
                    },
                },
                {
                    name: '数据达标',
                    type: 'bar',
                    color: '#50FAAB',
                    data: [125, 438, 300, 194, 141,183, 234, 234, 490, 104, 131, 144, 687],
                    itemStyle: {
                        normal: {
                            color: new echarts.graphic.LinearGradient(
                            1,
                            0,
                            0,
                            0,
                            [
                                {
                                offset: 0,
                                color: 'rgba(80, 250, 171, 1)'
                                },
                                {
                                offset: 1,
                                color: 'rgba(80, 250, 171, 0)'
                                }
                            ],
                            false
                            )
                        }
                    },
                }
            ]
};

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值