You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the integersOnly flag with a small domain (i.e. 0 to 0.7) the axis ticks become misaligned with the scaled data.
Notice the value of the left-most bar is 0.68574 but the top tick is displayed as 1 when the true value is 0.7.
Expected behaviour
Ticks are accurately displayed to align with the axis scale.
Additional context
This seems to be a bug in the visible_ticks.ts logic. When I disable the adaptiveTickCount it works as expected. Do you know what this adaptive logic is doing and why it's computed independently from the actual scale?
// let's remember the smallest triedTickCount that yielded two distinct ticks
fallbackReceivedTickCount=uniqueLabels.size;
fallbackAskedTickCount=triedTickCount;
}
}
}
return{ fallbackAskedTickCount };
};
So taking your example, like below, you can see the issue. But if I log the domain, range and ticks for all iterations of the y axis. You can see the first 3 are determined using the correct scale, the last 3 are from the code above, which appears to be walking the domain out from 0.7 to 0.8 to 1. This returns the ticks but these ticks are used with the scale computed originally with a different domain. 🤔 What the??
Describe the issue
Using the
integersOnly
flag with a small domain (i.e.0
to0.7
) the axis ticks become misaligned with the scaled data.Expected behaviour
Ticks are accurately displayed to align with the axis scale.
Additional context
This seems to be a bug in the
visible_ticks.ts
logic. When I disable theadaptiveTickCount
it works as expected. Do you know what this adaptive logic is doing and why it's computed independently from the actual scale?elastic-charts/packages/charts/src/chart_types/xy_chart/state/selectors/visible_ticks.ts
Lines 283 to 327 in 3b3aa03
So taking your example, like below, you can see the issue. But if I log the domain, range and ticks for all iterations of the y axis. You can see the first 3 are determined using the correct scale, the last 3 are from the code above, which appears to be walking the domain out from
0.7
to0.8
to1
. This returns the ticks but these ticks are used with the scale computed originally with a different domain. 🤔 What the??The text was updated successfully, but these errors were encountered: