echarts 漏斗圖示例


把以下代碼復制粘貼到:https://gallery.echartsjs.com/editor.html 可以預覽看到效果圖。

option = {
    color: ['#298DFF', '#2EC25B', '#FBD337'],
    backgroundColor: '#FFFFFF',
    barWidth: 8,
    title: {
        text: '漏斗圖'
    },
    tooltip: {
        axisPointer: {
            type: 'shadow'
        },
        trigger: 'item',
        formatter: '{b} : {c}'
    },
    grid: {
        left: '1%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    series: [
        {
            name: '',
            type: 'funnel',
            left: '5%',
            right: '35%',
            itemStyle: {  //去掉默認白色邊框線
                borderWidth: 0,
                borderColor: '#fff'
            },
            label: {
                show: true,
                formatter: "{b|{b}} "+"{b|:}"+"\n\n{a|{c}}",
                rich: {
                    a: {
                        color: '#595959',
                        fontSize: 12
                    },
                    b: {
                       color: '#595959',
                       fontSize: 12
                    }
                }
            },
            labelLine: {
                length: 50,
                lineStyle: {
                    width: 1,
                    color: '#ECECEC',
                    type: 'solid'
                }
            },
            data: [
                { name: '數量1',value: '7500.00' },
                { name: '數量2',value: '4000.00' },
                { name: '數量3',value: '2000.00' }
            ]
        }
    ]
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM