在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ eCharts折線圖的顯示

eCharts折線圖的顯示

請(qǐng)求的數(shù)據(jù),所顯示的折線圖沒有在規(guī)定的區(qū)間上
tooltip: {

trigger: 'axis',
axisPointer: {
    type: 'cross'
}

},
grid: {

left: '3%',
right: '4%',
bottom: '3%',
containLabel: true

},
dataZoom: [

{
    type: 'inside',
    start: 1,
    end: 100
}

],
xAxis: {

type: 'category',
data: [],
axisLabel: {
    formatter: function (value, idx) {
        var date = new Date(value);
        return idx === 0 ? value : [date.getMonth() + 1, date.getDate()].join('-');
    }
},
splitLine: {
    show: false
},
boundaryGap: false

},
yAxis: {

axisLabel: {
    formatter: function (val) {
        return val * 2;
    }
},
min: 0,
max: 110,
splitNumber: 10,
splitLine: {
    show: false
}

},
series: []

clipboard.png
其實(shí)數(shù)據(jù)的區(qū)間是在70~100,出現(xiàn)這種情況是為什么?

回答
編輯回答
執(zhí)念
axisLabel: {
    formatter: function (val) {
        return val * 2; // ?這里干嘛要給 y 軸的顯示數(shù)值乘以2?把這個(gè)去掉
    }
},

首先把 yAxis 軸里的 label formatter 刪掉,另外,Y 軸的最大值你可以通過遍歷數(shù)組確定,不要寫死110,或者直接設(shè)置成'dataMax'自動(dòng)獲取最大值。

2017年7月24日 00:21