[Bug] When the bar chart label is too long, it will exceed the coordinate system range and cover the y-axis label
Version
5.5.0
Link to Minimal Reproduction
Steps to Reproduce
Current Behavior
When the bar chart label is too long, it will exceed the coordinate system range and cover the y-axis label
Expected Behavior
The calculation of label position should take into account its length and always display it in the coordinate system
Environment
- OS:
- Browser:
- Framework:
Any additional comments?
I tried to find the source code for label position calculation and made corrections, but I couldn't find it. Maybe someone can provide some ideas, thank you
have you tried a combination of label's overflow, width and lineHeight? They are designed to help with long labels.
have you tried a combination of label's overflow, width and lineHeight? They are designed to help with long labels.
In the case of dense x-axis, if overflow hiding is used, the number of displayed words will be too small
Have you tried customizing the line wrapping operation by setting label.formatter? '\n' can be used
The effect is as follows
labelLayout(params) {
console.log(params) // learn more about the params here
return {
x: Math.max(45, params.labelRect.x),
y: params.labelRect.y
};
}