diff --git a/packages/charts/api/charts.api.md b/packages/charts/api/charts.api.md index 8f1a11ae7f..4477ad87c0 100644 --- a/packages/charts/api/charts.api.md +++ b/packages/charts/api/charts.api.md @@ -1927,6 +1927,7 @@ export const LineAnnotation: (props: SFProps, key // @public export interface LineAnnotationDatum { + ariaLabel?: string; dataValue: D; details?: string; header?: string; diff --git a/packages/charts/src/chart_types/xy_chart/renderer/dom/annotations/line_marker.tsx b/packages/charts/src/chart_types/xy_chart/renderer/dom/annotations/line_marker.tsx index 156e6e5ab7..867c62329b 100644 --- a/packages/charts/src/chart_types/xy_chart/renderer/dom/annotations/line_marker.tsx +++ b/packages/charts/src/chart_types/xy_chart/renderer/dom/annotations/line_marker.tsx @@ -119,6 +119,8 @@ export function LineMarker({ void popper?.current?.update?.(); + const ariaLabel = datum.ariaLabel ?? datum.details ?? datum.header ?? `line annotation ${datum.dataValue}`; + // want it to be tabbable if interactive if there is a click handler return clickable ? (