Skip to content

Commit

Permalink
fix(chart): update isLegendEnabled instead of isEnabled
Browse files Browse the repository at this point in the history
  • Loading branch information
scottdickerson committed Jan 17, 2020
1 parent 941b88a commit d413a8c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/core/src/axis-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -102,7 +102,7 @@ export class AxisChart extends Chart {
this.model,
this.services,
[
...(isEnabled ? [ legendComponent ] : [ ]),
...(isLegendEnabled ? [ legendComponent ] : [ ]),
legendSpacerComponent,
graphFrameComponent
],
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -190,7 +190,7 @@ export class Chart {
this.model,
this.services,
[
...(isEnabled ? [ legendComponent ] : [ ]),
...(isLegendEnabled ? [ legendComponent ] : [ ]),
legendSpacerComponent,
graphFrameComponent
],
Expand Down

0 comments on commit d413a8c

Please sign in to comment.