echarts 柱狀圖形狀修改爲等腰三角形

option = {
    tooltip: {
        trigger: 'axis',
        axisPointer: {
            type: 'none'
        },
        formatter: function (params) {
            return params[0].name + ': ' + params[0].value;
        }
    },
    xAxis: {
        data: ['馴鹿', '火箭', '飛機', '高鐵', '輪船', '汽車', '跑步', '步行', ],
        axisTick: {show: true},
        axisLine: {show: true},
        axisLabel: {
            textStyle: {
                color: '#e54035'
            }
        }
    },
    yAxis: {
        splitLine: {show: true},
        axisTick: {show: true},
        axisLine: {show: true},
        axisLabel: {show: true}
        
    },
    color: ['#e54035'],
    series: [{
        name: 'hill',
        type: 'pictorialBar',
        //位置偏移
        barCategoryGap: '-10%',
        //圖形寬度
        barWidth:50,
        //圖形形狀
        symbol: 'path://M150 50 L130 130 L170 130  Z',
        itemStyle: {
            normal: {
                opacity: 0.9
            },
            emphasis: {
                opacity: 1
            }
        },
        data: [123, 60, 25, 18, 12, 9, 20, 111],
        z: 10
    }, {
        name: 'glyph',
        type: 'pictorialBar',
        barGap: '-100%',
        symbolPosition: 'end',
        symbolSize: 50,
        symbolOffset: [0, '-120%']
    }]
};
相關文章
相關標籤/搜索