如何使用echarts为watefall图表的初始柱和结束柱设置不同的配色方案?

时间:2019-11-07 02:30:34

标签: echarts waterfall

如何为瀑布形的初始栏和结束栏创建配色方案?

echartWaterfall.setOption({
    title: {
        text: '',
        subtext: 'RM mil'
    },
    color: ['#D90429', '#2B4384', '#8CD33B', '#1E8EBA', '#23C9D1'],
    legend: {
        x: 'center',
        y: 'top',
        data: ['increase', 'decrease']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '12%',
        containLabel: true
    },
    xAxis: {
        type: 'category',
        interval: 'auto',
        splitLine: { show: false },
        data: ['B/f', 'Revenue', 'Oth Inc', 'COS', 'Staff', 'RentSum', 'OthRent', 'S&D', 'R&M', 'Utilities', 'Admin', 'EBITDA'],
        //axisLabel: {
            //rotate: 25
        //}
    },
    yAxis: {
        type: 'value'
    },
    series: [{
        name: 'output',
        type: 'bar',
        stack: 'Changes',
        itemStyle: {
            normal: {
                barBorderColor: 'rgba(0,0,0,0)',
                color: 'rgba(0,0,0,0)'
            },
            emphasis: {
                barBorderColor: 'rgba(0,0,0,0)',
                color: 'rgba(0,0,0,0)'
            }
        },
        data: []    // cumulative
    }, {
        name: 'increase',
        type: 'bar',
        stack: 'Changes',
        label: {
            normal: {
                show: true,
                position: 'top'
            }
        },
        data: []  // increase
    }, {
        name: 'decrease',
        type: 'bar',
        stack: 'Changes',
        label: {
            normal: {
                show: true,
                position: 'bottom'
            }
        },
        data: []  // decrease
    }]
});

0 个答案:

没有答案