// 折线图
initLineEcharts() {
let _this = this;
let charts: any = _this.$echarts.init(document.getElementById("mainLine"));
charts.setOption({
grid: {
x: "12%",//x 偏移量
y: "7%", // y 偏移量
width: "87%", // 宽度
height: "79%"// 高度
},
xAxis: {
type: "category",
boundaryGap: false,
data: [
"00:00",
"02:00",
"04:00",
"06:00",
"08:00",
"10:00",
"12:00",
"14:00",
"16:00",
"18:00",
"20:00",
"22:00"
],
axisLabel: {
interval: 0, // 让字体完全显示
rotate: 20 // 字体旋转
},
},
yAxis: {
type: "value",
// 隐藏y轴
axisLine: {
show: false
},
Echarts y轴高度设置(宽度铺满整个父级高度)
最新推荐文章于 2024-07-08 14:56:22 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)