ECHARTS 使用記錄

1、Y軸如何顯示百分比。

option = {
    color: ['#3398DB'],
    tooltip : {
        trigger: 'item',
        formatter: "{a} <br/>{b}:({c} %)"
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis : [
        {
            type : 'category',
            data : ['24歲以下', '24歲到30歲', '31到35歲', '36歲到40歲', '41歲及以上'],
            axisTick: {
                alignWithLabel: true
            }
        }
    ],
    yAxis : [
        {
            type : 'value',
            min : 0,
            max : 100,
            axisLabel:{
                formatter: '{value} %'
            }


        }
    ],
    series : [
        {
            name:'用戶數',
            type:'bar',
            barWidth: '60%',
            data:[10,10,10,10,60],
            itemStyle:{
                normal:{
                    lable:{
                    show:true,
                    formatter:'{a}%'
                    }
                }
            }
        }
    ]
};
發佈了153 篇原創文章 · 獲贊 20 · 訪問量 38萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章