測試地址
https://www.echartsjs.com/examples/zh/editor.html?c=bar-tick-align
var option = { title: { text: "存儲條件(基本單位數量)", //標題 padding: [12, 4], //距離上下4px x: "center", //居中 textStyle: { color: "#3398DB", //主標題的顏色 fontSize: "18" //主標題的大小 }, }, color: ['#3398DB'], tooltip : { trigger: 'axis', formatter:'{c}%', //這是關鍵,以百分比的形式顯示 axisPointer : { // 坐標軸指示器,坐標軸觸發有效 type : 'shadow' // 默認為直線,可選為:'line' | 'shadow' } }, grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, xAxis : [ { type : 'category', data : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], axisTick: { alignWithLabel: true } } ], yAxis: [ { type: 'value', axisLabel: { show: true, interval: 'auto', formatter: '{value} %' }, show: true } ], label: { show: true, position: 'top', formatter: '{b}\n{c}%' //在柱狀圖的頂部顯示出某個東西和這個東西的百分比值 }, series : [ { name:'直接訪問', type:'bar', barWidth: '60%', data:[10, 52, 20, 34, 39, 30, 20] } ] }; 測試地址 https://www.echartsjs.com/examples/zh/editor.html?c=bar-tick-a