Axis tick auto align on multiaxis
See original GitHub issueWhat problem does this feature solve?
I want to have a functionality which allows the user to have the same number of ticks on every parallel axis.
i.e. I have 2 yAxis
, but the auto ticks calculation gives me 6 ticks for one axis and 5 for the other. The difference creates irregular spacings between the split lines, which is not really good for user experience.
Here is the sample option
code:
option = {
"xAxis": [
{
"data": ["test"]
}
],
"yAxis": [
{
"name": "A",
},
{
"name": "B",
}
],
"series": [
{
"name": "A",
"type": "bar",
"data": [
275500000,
],
"yAxisIndex": 0
},
{
"name": "B",
"type": "bar",
"data": [
2289000000
],
"yAxisIndex": 1
},
]
}
And here is the sample result:
My request is based on the HighCharts library, which provides an API called alignTicks
, which does the same thing as I described here.
What does the proposed API look like?
Let’s say we have a boolean attribute yAxis.axisAutoAlign
. By setting it to true, its ticks will get aligned with every other axis in the yAxis
array which has the same boolean to true
. That way, if one of the axis has 6 ticks, all the other axis will also have 6 ticks and get nicely aligned altogether.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:7 (2 by maintainers)
Top GitHub Comments
@tidemarks 这个改动影响面很大,需要很多验证,所以短期不会合入。
This is an important feature and we should have some further discussion about it. Probably it’s not easy to implement this and may be done in v5.0.