问题描述
在使用echarts
折线图中渲染出来的图表数据不是从原点坐标开始,而是在两点的中间显示。
解决方法
在xAxis
字段中添加一个boundaryGap
属性;
xAxis: {
data: ['0时', '1时', '2时', '3时', '4时', '5时', '6时', '7时', '8时', '9时', '10时', '11时', '12时', '13时', '14时', '15时', '16时', '17时', '18时', '19时', '20时', '21时', '22时', '23时'],
type: 'category',
name: '时段',
boundaryGap: false // 显示间距设置为false
},
这样就可以了:
求点赞 求评论 求收藏 ~~ 相互关注指点一波 ~~ 求点赞 求评论 求收藏