diff --git a/packages/core/src/axis-chart.ts b/packages/core/src/axis-chart.ts index 30ba6d9808..517b8be316 100644 --- a/packages/core/src/axis-chart.ts +++ b/packages/core/src/axis-chart.ts @@ -61,11 +61,11 @@ export class AxisChart extends Chart { } }; - const isEnabled = this.model.getOptions().legend.enabled !== false; + const isLegendEnabled = this.model.getOptions().legend.enabled !== false; // Decide the position of the legend in reference to the chart let fullFrameComponentDirection = LayoutDirection.COLUMN; - if (isEnabled) { + if (isLegendEnabled) { const legendPosition = Tools.getProperty(this.model.getOptions(), "legend", "position"); if (legendPosition === LegendPositions.LEFT) { fullFrameComponentDirection = LayoutDirection.ROW; @@ -102,7 +102,7 @@ export class AxisChart extends Chart { this.model, this.services, [ - ...(isEnabled ? [ legendComponent ] : [ ]), + ...(isLegendEnabled ? [ legendComponent ] : [ ]), legendSpacerComponent, graphFrameComponent ], diff --git a/packages/core/src/chart.ts b/packages/core/src/chart.ts index 74f0629134..b5e5a32a6f 100644 --- a/packages/core/src/chart.ts +++ b/packages/core/src/chart.ts @@ -149,11 +149,11 @@ export class Chart { } }; - const isEnabled = this.model.getOptions().legend.enabled !== false; + const isLegendEnabled = this.model.getOptions().legend.enabled !== false; // TODORF - REUSE BETWEEN AXISCHART & CHART // Decide the position of the legend in reference to the chart let fullFrameComponentDirection = LayoutDirection.COLUMN; - if (isEnabled) { + if (isLegendEnabled) { const legendPosition = Tools.getProperty(this.model.getOptions(), "legend", "position"); if (legendPosition === "left") { fullFrameComponentDirection = LayoutDirection.ROW; @@ -190,7 +190,7 @@ export class Chart { this.model, this.services, [ - ...(isEnabled ? [ legendComponent ] : [ ]), + ...(isLegendEnabled ? [ legendComponent ] : [ ]), legendSpacerComponent, graphFrameComponent ],