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
nebojsa-peric
changed the title
TimeAxis doesn't respect minLabelDistnace in specific scenarios
TimeAxis doesn't respect minLabelDistance in specific scenarios
Sep 30, 2024
Here's my finding, we calculate tick sizes using minTickDistance, in this case small number compared to minLabelDistance. tickSizes are calculated in the calculateTicks method, when the unit is equal to week, for this specific scenario, causing tickMeasure to be preserved as week. Additionally, at the end of the method, tickSizes are filtered by comparing them to minTickDistance value.
In the renderTicksAndLabels method of Axis class, following is done calculator.findTickSize(this.minLabelDistance);. Since minLabelDistance is much bigger than the minTickDistance, the function doesn't return the first tick size (week scale), but rather the second one (month scale). Later on in this function, following is done: var ticks = calculator.getTicks([size]);. The size here is a month of milliseconds, while the function relates to the tickMeasure value only (size property seems unused), and returns the values representing the weeks.
Increasing minTickUnit to 62 in the given example, "solves" the issue, however, it seems like this is a bug caused by not considering the size property in the getTicks function in scenario: ...else if (this.tickMeasure == "day" || this.tickMeasure == "week").
Fixing this might also solve the need to define minLabelDistance at first place.
The text was updated successfully, but these errors were encountered: