echarts 排行榜样式实现

var labelSetting = {
    normal: {
        show: true,
        position: 'right',
        offset: [10, 0],
        textStyle: {
            fontSize: 16
        }
    }
};
var maxData=200000
var option = {
     title: {
        text: '中国苹果汁出口贸易数据'
    },
    dataset: {
        source: [
            ['score', 'amount', 'product'],
            [89.3, 58212, 'Matcha Latte'],
            [57.1, 78254, 'Milk Tea'],
            [74.4, 41032, 'Cheese Cocoa'],
            [50.1, 12755, 'Cheese Brownie'],
            [89.7, 20145, 'Matcha Cocoa'],
            [68.1, 79146, 'Tea'],
            [19.6, 91852, 'Orange Juice'],
            [10.6, 101852, 'Lemon Juice'],
            [32.7, 20112, 'Walnut Brownie']
        ]
    },
    grid: {containLabel: true},
    xAxis: {name: 'amount',splitLine: {show: false},axisLine: {show: false},axisTick: {show: false}, axisLabel: {show: false},},
    yAxis: {type: 'category',axisTick: {show: false},
        axisLine: {show: false},
        axisLabel: {
            margin: 10,
            textStyle: {
                color: '#999',
                fontSize: 16
            }
        }},

    series: [
        {
            type: 'pictorialBar',
            label: labelSetting,
            symbol: 'rect',
            itemStyle: {
            
            normal: {
                color: '#007eb1',
                
            }
        },
            encode: {
                // Map the "amount" column to X axis.
                x: 'amount',
                // Map the "product" column to Y axis
                y: 'product'
            },
            z:10
            
        },
        {
        // full data
        type: 'pictorialBar',
        itemStyle: {
            
            normal: {
                color: '#7dbad2',
                opacity: 0.2
            }
        },
       /* symbolRepeat: 'fixed',*/
/*        symbolMargin: '5%',
*/      symbol: 'rect',
/*        symbolSize: 30,*/
        symbolBoundingData: maxData,
        encode: {
                // Map the "amount" column to X axis.
                x: 'amount',
                // Map the "product" column to Y axis
                y: 'product'
            },
        z: 5
    }
    ]
};

效果展示图:

编写不易如果觉得不错,麻烦关注一下~

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值