echarts 柱状图 - 一条条椭圆形状累计的柱状图

function waterQualityGrade (){
    var cw = document.body.clientHeight / 70;

    var textStyle = {
        fontSize : cw,
        color: "rgba(255,255,255,0.6)",
    }
    var  axisLabel = {
        show: true,
        textStyle: {
            fontSize:cw,
            color: "rgba(255,255,255,0.6)"
        }
    }
    var axisLine = {
        lineStyle: {
            color:"rgba(221,221,221,0.1)",
        }
    }

    var lineStyle = {
        color: "rgba(221,221,221,0.1)",
    }

    //柱状图、折线图等的用这个
    var tooltipAxis = {
        trigger: 'axis',
        backgroundColor:'rgba(26,34,126,.9)',
        padding:10,
        borderRadius: 4,
        textStyle:{
            fontSize:12,
        },
        extraCssText:'box-shadow:0 0 18px rgba(255,255,255,0.2)'
    }


    var waterQualityGrade = echarts.init(document.getElementById('waterQualityGrade'));

    var option ={
        title: {
            text: '单位:分数',
            textStyle:textStyle ,
            show:true
        },
        tooltip: tooltipAxis,
        legend: {
            data:['得分'],
            inactiveColor :'rgba(92,200,255,0.35)',
            icon:'roundRect',
            top:0,
            right:0,
            textStyle: {
                color: 'rgba(92,200,255,1)'
            },
            itemWidth:1.6*cw,
            itemHeight:0.5*cw,
            show:true
        },
        grid: {
            left: '2%',
            right: '3%',
            bottom: '0',
            top:"18%",
            containLabel: true
        },
        xAxis: {
            type: 'category',
            boundaryGap: true,
            axisLabel:axisLabel,
            axisLine:axisLine,
            axisTick:{
                show:true,
                inside:true
            },
            splitLine : {
                show : false
            },
            data: [200, 200, 200, 200, 200, 200, 200, 200, 200, 200],
        },
        yAxis: {
            type: 'value',
            axisLabel:axisLabel,
            axisLine:axisLine,
            axisTick:{ //y轴刻度线
                show:false
            },
            splitLine:{
                show: true,
                lineStyle: lineStyle,
            },
        },
        series: [ {
            name: '得分',
            stack: '总量',
            type: 'pictorialBar',
            symbol: 'roundRect',
            itemStyle: {
                color: 'rgba(72,252,255,1)'
            },
            barWidth: '20%',
            symbolRepeat: true,
            symbolSize: [1*cw, 0.15*cw],
            // symbolBoundingData: 100,
            symbolMargin: 1,
            symbolPosition: 'start',
            z: -20,
            data: [200, 200, 200, 200, 200, 200, 200, 200, 200, 200],
            label: {
                normal: {
                    show: false,
                    position: 'top',
                    verticalAlign: 'top'
                    // formatter: function(value){
                    //   return value && (value.data * 100).toFixed(1) + '%'
                    // }
                }
            }
        },{
            name: '全部',
            type: 'pictorialBar',
            symbol: 'roundRect',
            tooltip:{
                show:false
            },
            itemStyle: {
                color: 'rgba(27,183,255,0.14)'
            },
            barWidth: '20%',
            symbolRepeat: true,
            symbolSize: [1*cw, 0.15*cw],
            // symbolBoundingData: 100,
            symbolMargin: 1,
            symbolPosition: 'start',

            label: {
                show: false
            },
            z: -10,
            data: [200, 200, 200, 200, 200, 200, 200, 200, 200, 200]
        }]
    };

    waterQualityGrade.setOption(option);
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值