As shown in the figure below, the X-axis label text Mon is located between the two tick marks:
The desired effect is as shown in the figure below, with the label text Mon directly below the tick mark:
Just add the alignWithLabel attribute of axisTick to xAxis and set the attribute value to true:
option = {
xAxis: {
type: 'category',
axisTick: {
alignWithLabel: true, // true:标签位于刻度线正下方;false:标签位于2个刻度线中间
},
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
......
};