echarts 柱状图 x轴倾斜
时间: 2023-08-27 12:16:37 浏览: 228
echarts柱状图
在Echarts中,可以通过设置x轴的axisLabel的rotate属性来实现x轴标签的倾斜显示。具体的代码如下所示:
```javascript
xAxis: [
{
type: 'category',
data: this.alarmTList,
axisTick: {
alignWithLabel: true
},
axisLabel: {
interval: 0,
rotate: 45
}
}
]
```
以上代码中,rotate属性的值设置为45,表示将x轴标签以45度的角度进行倾斜显示。你也可以根据需要调整倾斜度,取值范围在-90至90之间,默认为0表示不倾斜。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Echarts柱状纵向横向、圆角、渐变、x轴字体倾斜或垂直显示](https://blog.csdn.net/weixin_45440916/article/details/120234043)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [vue + echarts 柱状图 x轴倾斜/竖排显示](https://blog.csdn.net/weixin_38673922/article/details/122237885)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [Echart 柱状图,X轴斜着展示](https://blog.csdn.net/qq_45424679/article/details/128107833)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文