Skip to content

Commit

Permalink
Merge pull request #1945 from ag-grid/fix-navigator-zoom-axes-bug
Browse files Browse the repository at this point in the history
Fix mini-chart breaking drag-to-zoom-axes.
  • Loading branch information
alantreadway authored Jun 28, 2024
2 parents a45b9d5 + de53ad1 commit ad2ea34
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/ag-charts-community/src/chart/chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,7 @@ export abstract class Chart extends Observable {
if (seriesStatus === 'replaced') {
this.resetAnimations();
}
if (this.applyAxes(this, newOpts, oldOpts, seriesStatus)) {
if (this.applyAxes(this, newOpts, oldOpts, seriesStatus, [], true)) {
forceNodeDataRefresh = true;
}

Expand Down Expand Up @@ -1932,7 +1932,8 @@ export abstract class Chart extends Observable {
options: AgChartOptions,
oldOpts: AgChartOptions,
seriesStatus: SeriesChangeType,
skip: string[] = []
skip: string[] = [],
registerRegions = false
) {
if (!('axes' in options) || !options.axes) {
return false;
Expand Down Expand Up @@ -1969,8 +1970,10 @@ export abstract class Chart extends Observable {

chart.axes.forEach((axis) => axisGroups[axis.direction].push(axis.getAxisGroup()));

this.ctx.regionManager.updateRegion(REGIONS.HORIZONTAL_AXES, ...axisGroups[ChartAxisDirection.X]);
this.ctx.regionManager.updateRegion(REGIONS.VERTICAL_AXES, ...axisGroups[ChartAxisDirection.Y]);
if (registerRegions) {
this.ctx.regionManager.updateRegion(REGIONS.HORIZONTAL_AXES, ...axisGroups[ChartAxisDirection.X]);
this.ctx.regionManager.updateRegion(REGIONS.VERTICAL_AXES, ...axisGroups[ChartAxisDirection.Y]);
}

return true;
}
Expand Down

0 comments on commit ad2ea34

Please sign in to comment.