-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(axis): rotated horizontal xAxisHeight is calculated correctly aft…
…er loading new data 'maxTickWidths.x.ticks' have to be cached before calculating xAxisHeight for correct xAxisHeight calculation. By updating XAxisTickClip BEFORE calculating xAxisHeight we can make use of a side effect, which will cache 'maxTickWidths.x.ticks'. The side effect is caused by following call stack: - updateXAxisTickClip() --> getHorizontalAxisHeight() --> $$.axis.getMaxTickWidth() - In this case, 'maxTickWidths.x.ticks' will be calculated and cached, and XAxisTickClip will be updated. Empty 'maxTickWidths.x.ticks' before recalculation to prevent keeping old state after new data is loaded into the chart. Added 'axis_x_tick_count' for tick count calculation in 'getAxisTickRotate()' as setting tick count manually would break the autorotation. Added extra checks for places in the code where values could have been divided by zero to avoid runtime errors. Added extra condition for tick offset calculation. There was a missing check if every 'currentTicksMax.domain' is greater than zero. Due to this, if new data was laoded with 'unload: true' it could happen, that 'currentTicksMax.domain' would be [0,0]. In this case, even if the domain is not same, it would always result in returning 'currentTicksMax.size'and not updating 'currentTicksMax.domain' which resulted in not updating the rotation on x axis. Calculating tick offset is only necessary when setting 'axis_x_tick_count' on x axis type 'category'. It should be calculated only if lower or equal than the actual amount of filtered targets that should have been shown. Fix #1786 Close #1787
- Loading branch information
Showing
7 changed files
with
75 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters