Skip to content

Description property for the chart legend does not override the default aria-label #9642

@MarkMcAmhlaidh

Description

@MarkMcAmhlaidh

Bug Description

Current Behaviour

  • Legend elements always use default aria-label values regardless of the description property being set.
  • Custom accessibility labels, set with the description property are ignored.
  • Localisation of legend text is not possible.

Expected Behavior

Impact

  • Accessibility: Users relying on screen readers cannot understand chart legends in their language
  • Localisation: Cannot provide localised aria-labels international users

Reproduction Steps

  • Create a chart with a legend
  • Set the description property on the legend configuration
  • Inspect the legend elements on your browser
  • You will see that the default values are used instead of the custom description
{
  "$schema": "https://vega.github.io/schema/vega-lite/v6.json",
  "data": {"url": "data/barley.json"},
  "mark": "bar",
  "encoding": {
       "x": {"aggregate": "sum", "field": "yield"},
       "y": {"field": "variety"},
       "color": {
          "field": "site", 
          "legend": {
             "description": "test custom label",
          }
       }
  }
}
Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions