Version
5.5.1
Link to Minimal Reproduction
Steps to Reproduce
set the first item to left-align, red color.
but left align is invalid.
option = {
color: ['#3398DB'],
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
grid: {},
xAxis: [
{
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisLabel: {
formatter: (value, index) => {
if (index === 0) return `{left|${value}}`;
return value;
},
rich: {
left: {
align: 'left',
color: 'red'
}
},
align: 'right'
}
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: '直接访问',
type: 'bar',
barWidth: '60%',
data: [10, 52, 200, 334, 390, 330, 220]
}
]
};
Current Behavior
left align is invalid.
Expected Behavior
the first item is right align
Environment
- OS:
- Browser:
- Framework:
Any additional comments?
No response
1条答案
按热度按时间w6lpcovy1#
you need to add axisLabel.width and remove axisLabel.align - Demo