Skip to content

Grouped HorizontalBarChart should display legend by default #1224

Description

@jaronheard

Is your feature request related to a problem? Please describe.
Currently, the HorizontalBarChart with the grouped chart will not display a legend unless it is passed an array of dataSeriesLabels.

Example:
The chart shown in this story requires the following dataSeriesLabel in order to display a legend.
Screen Shot 2020-09-13 at 6 45 25 PM

dataSeriesLegend: [
  {
    "category": "Poodle",
    "label": "Poodle"
  },
  {
    "category": "Bulldog",
    "label": "Bulldog"
  }
]

Otherwise, the chart will look like this:
Screen Shot 2020-09-13 at 6 48 27 PM

dataSeriesLegend: null

Describe the solution you'd like
Should populate the legend based on the values of dataSeriesKey by default.

Describe alternatives you've considered
Could keep as is, but requires extra work from component users.

Additional context
The legend component can be overridden with the legendComponent prop, so there's no need to provide an extra override to hide the legend.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions