Skip to content

Commit

Permalink
Fixing chartjs (#23831) (#23851)
Browse files Browse the repository at this point in the history
  • Loading branch information
aasimkhan30 committed Jul 13, 2023
1 parent a644558 commit 5299cd4
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions src/sql/workbench/contrib/charts/browser/graphInsight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,11 @@ export class Graph implements IInsight {
};

if (options.xAxisMax !== undefined) {
retval.scales = mixin(retval.scales, { xAxes: [{ ticks: { max: options.xAxisMax } }] }, true, customMixin);
retval.scales = mixin(retval.scales, { x: { max: options.xAxisMax } }, true, customMixin);
}

if (options.xAxisMin !== undefined) {
retval.scales = mixin(retval.scales, { xAxes: [{ ticks: { min: options.xAxisMin } }] }, true, customMixin);
retval.scales = mixin(retval.scales, { x: { min: options.xAxisMin } }, true, customMixin);
}

retval.scales.y = {
Expand All @@ -242,35 +242,31 @@ export class Graph implements IInsight {
};

if (options.yAxisMax !== undefined) {
retval.scales = mixin(retval.scales, { yAxes: [{ ticks: { max: options.yAxisMax } }] }, true, customMixin);
retval.scales = mixin(retval.scales, { y: { max: options.yAxisMax } }, true, customMixin);
}

if (options.yAxisMin !== undefined) {
retval.scales = mixin(retval.scales, { yAxes: [{ ticks: { min: options.yAxisMin } }] }, true, customMixin);
retval.scales = mixin(retval.scales, { y: { min: options.yAxisMin } }, true, customMixin);
}

if (this.originalType === ChartType.TimeSeries) {
retval = mixin(retval, timeSeriesScales, true, customMixin);
if (options.xAxisMax !== undefined) {
retval = mixin(retval, {
scales: {
xAxes: [{
time: {
max: options.xAxisMax
}
}],
x: {
max: options.xAxisMax
}
}
}, true, customMixin);
}

if (options.xAxisMin !== undefined) {
retval = mixin(retval, {
scales: {
xAxes: [{
time: {
min: options.xAxisMin
}
}],
x: {
min: options.xAxisMin
}
}
}, true, customMixin);
}
Expand Down

0 comments on commit 5299cd4

Please sign in to comment.