echarts的横坐标的没有具体的标示, X坐标没有一个格子来提示, 下面有图具体说明
以下是标准格式
js
/* 蒸发 */
createChartSix() {
this.$http
.get(this.$api.dataChart)
.then(rsp => {
if (rsp.status == 200) {
let resData = rsp.data.data.device_1;
let key = "蒸发_1";
let xAxisData = resData[key].names;
let seriesData = resData[key].values;
let yMin = Math.min.apply(null, seriesData);
let yMax = Math.max.apply(null, seriesData);
var home_echarts_evaporation = echarts.init(
document.getElementById("home_echarts_evaporation")
);
var speed = {
grid: {
left: 60
},
xAxis: {
type: "category",
data: xAxisData,
axisLabel: {
show: true,
textStyle: {
color: "#fff"
}
},
axisLabel: {
show: true,
textStyle: {
color: "#fff"
}
},
axisLine: {
lineStyle: {
color: "#285555"
}
}
},
yAxis: {
type: "value",
min: yMin - 5,
max: yMax + 5,
axisLine: {
lineStyle: {
color: "#275454"
}
},
axisLabel: {
show: true,
textStyle: {
color: "#fff"
}
},
splitLine: {
lineStyle: {
color: ["#0a3435"]
}
}
},
lineStyle: {
color: "#0066ff"
},
series: [
{
data: seriesData,
type: "line",
smooth: true
}
]
};
var resize = {
width: 415,
height: 290
};
home_echarts_evaporation.resize(resize);
home_echarts_evaporation.setOption(speed);
} else {
throw rsp.message;
}
})
.catch(err => {
console.log("createChartOne有异常", err);
});
哪里不一致了???
Y轴
0-1-2-3-4-5
间隔,只是Y轴没有把1和3
的标出来而已参考:http://echarts.baidu.com/opti...