Skip to content

Commit

Permalink
fix(heatmap-choropleth):legend hidden when data array is empty (#1763)
Browse files Browse the repository at this point in the history
  • Loading branch information
RiyaJethwa committed Feb 26, 2024
1 parent 7f9cade commit 25274d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/core/src/charts/choropleth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ export class ExperimentalChoroplethChart extends Chart {

const isLegendEnabled =
getProperty(configs, 'legend', 'enabled') !== false &&
this.model.getOptions().legend.enabled !== false
this.model.getOptions().legend.enabled !== false &&
this.model.getData().length > 0

// Decide the position of the legend in reference to the chart
const fullFrameComponentDirection = LayoutDirection.COLUMN_REVERSE
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/charts/heatmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ export class HeatmapChart extends AxisChart {

const isLegendEnabled =
getProperty(configs, 'legend', 'enabled') !== false &&
this.model.getOptions().legend.enabled !== false
this.model.getOptions().legend.enabled !== false &&
this.model.getData().length > 0

// Decide the position of the legend in reference to the chart
const fullFrameComponentDirection = LayoutDirection.COLUMN_REVERSE
Expand Down

0 comments on commit 25274d7

Please sign in to comment.