javascript - 如何为长日期字符串增加轴下方的空间?
解决方案
你可以设置grid
选项可以实现这个目标:
grid.containLabel = true
如果你喜欢,还可以设置:
grid.bottom = 0
例如:
option = {
xAxis: {
type: 'category',
axisLabel: {
interval: 1,
rotate: 45
},
data: ['2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04', '2018-06-07 14:27:04']
},
yAxis: {
type: 'value'
},
grid: {
bottom: 0,
containLabel: true
},
series: [{
data: [820, 932, 901, 934, 1290, 1330, 1320, 820, 932, 901, 934, 1290, 1330, 1320, 820, 932, 901, 934, 1290, 1330, 1320, 820, 932, 901, 934, 1290, 1330, 1320,820, 932, 901, 934, 1290, 1330, 1320],
type: 'line',
smooth: true
}]
};
推荐阅读
- php - 用于从字段中删除所有标签的 MY SQL 查询
- flask - flask-migrate:如何添加新数据库
- dynamic-programming - 动态规划。硬币行问题 - 如何发展其递归关系
- cassandra - Cassandra:不正确的复制命令
- reactjs - reactjs中firestore的新文档参考
- javascript - 一次在 Rx.Observable 中执行的一个 Promise
- python - 搜索元组列表并显示结果
- android - 在 onAdLeftApplication() 和 onAdClosed() 中写什么?,因为点击 Admob 广告不会让返回到我的应用程序
- r - R的神经网络包中使用了哪种类型的梯度下降?
- javascript - Rails 的 ActionCable 服务器端订阅参数