diff --git a/change/@fluentui-react-charting-2f20f310-a538-4c9b-b93c-be8158fe1c65.json b/change/@fluentui-react-charting-2f20f310-a538-4c9b-b93c-be8158fe1c65.json new file mode 100644 index 00000000000000..9c394b8df7e91c --- /dev/null +++ b/change/@fluentui-react-charting-2f20f310-a538-4c9b-b93c-be8158fe1c65.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Fix duplicate-id accessibility issue in line chart", + "packageName": "@fluentui/react-charting", + "email": "kumarkshitij@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-charting/src/components/LineChart/LineChart.base.tsx b/packages/react-charting/src/components/LineChart/LineChart.base.tsx index 286b5746669600..1c93e3b9bd92fd 100644 --- a/packages/react-charting/src/components/LineChart/LineChart.base.tsx +++ b/packages/react-charting/src/components/LineChart/LineChart.base.tsx @@ -523,11 +523,11 @@ export class LineChartBase extends React.Component this._yAxisScale(d[1])) .curve(d3curveLinear); - const lineId = `${this._lineId}${i}`; - const borderId = `${this._borderId}${i}`; + const lineId = `${this._lineId}_${i}`; + const borderId = `${this._borderId}_${i}`; const strokeWidth = this._points[i].lineOptions?.strokeWidth || this.props.strokeWidth || DEFAULT_LINE_STROKE_SIZE; @@ -664,9 +664,9 @@ export class LineChartBase extends React.Component diff --git a/packages/react-charting/src/components/LineChart/__snapshots__/LineChart.test.tsx.snap b/packages/react-charting/src/components/LineChart/__snapshots__/LineChart.test.tsx.snap index db3e2e223ec4bf..13f54797d71c2a 100644 --- a/packages/react-charting/src/components/LineChart/__snapshots__/LineChart.test.tsx.snap +++ b/packages/react-charting/src/components/LineChart/__snapshots__/LineChart.test.tsx.snap @@ -111,8 +111,8 @@ exports[`LineChart - mouse events Should render callout correctly on mouseover 1 />