在没风的地方找太阳  在你冷的地方做暖阳 人事纷纷  你总太天真  往后的余生  我只要你 往后余生  风雪是你  平淡是你  清贫也是你 荣华是你  心底温柔是你  目光所致  也是你 想带你去看晴空万里  想大声告诉你我为你着迷 往事匆匆  你总会被感动  往后的余生  我只要你 往后余生  冬雪是你  春花是你  夏雨也是你 秋黄是你  四季冷暖是你  目光所致  也是你 往后余生  风雪是你  平淡是你  清贫也是你 荣华是你  心底温柔是你  目光所致  也是你
jQuery火箭图标返回顶部代码 - 站长素材

echarts 实现正负轴双柱状图


option = {
    title: {
        show: true,
        text: '产品留存分析',
        textAlign: 'auto',
        left: 'center'
    },
    tooltip: {
        show: false,
        trigger: 'axis',
        axisPointer: {            // 坐标轴指示器,坐标轴触发有效
            type: 'shadow'        // 默认为直线,可选为:'line' | 'shadow'
        }
    },
    legend: {
        show: false,
        data: ['利润', '支出', '收入']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis: [
        {
            type: 'value',show:false,
            splitLine:{
            show:false
          },
            axisTick: {
                show: false
            },
        }
    ],
    yAxis: [
        {
            type: 'category',
            axisTick: {
                show: false
            },
            axisLine:{
                show: true,
                onZero:false,
                
            },
            axisTick: {
                show: false
            },
            data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
            
            splitLine:{
            show:false
          }

        }
    ],
    color: ['#0033cc'],
    series: [
        {
            name: '支出',
            type: 'bar',
            stack: '总量',
            label: {
                show: false,
                color:'white',
                // position: 'insideRight',
                // distance: -11
            },
            data: [-200, -302, -341, -500, -200, -450, -800]
        },
        {
            name: '收入',
            type: 'bar',
            stack: '总量',
            z:10,//防止数字被覆盖
            label: {
                show: true,
                color:'white',
                position: 'insideLeft',
                distance: -11
            },
            data: [200, 302, 341, 500, 200, 450, 800]
        }
    ]
};

 

效果如下:

 

posted @ 2020-05-11 17:17  艺术诗人  阅读(4109)  评论(0编辑  收藏  举报