Skip to content

Commit

Permalink
fix(declarative-chart): Remove Duplicate keys warning (#33722)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anush2303 authored Jan 24, 2025
1 parent 1466381 commit ab504b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Fix Duplicate keys warning",
"packageName": "@fluentui/react-charting",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ export class VerticalBarChartBase
const gradientId = getId('VBC_Gradient') + `_${index}_${startColor}`;

return (
<g key={point.x as string}>
<g key={`${point.x}_${index}` as string}>
{this.props.enableGradient && (
<defs>
<linearGradient id={gradientId} x1="0%" y1="100%" x2="0%" y2="0%">
Expand Down Expand Up @@ -892,7 +892,7 @@ export class VerticalBarChartBase

return (
<g
key={point.x instanceof Date ? point.x.getTime() : point.x}
key={point.x instanceof Date ? `${point.x.getTime()}_${index}` : `${point.x}_${index}`}
transform={`translate(${0.5 * (xBarScale.bandwidth() - this._barWidth)}, 0)`}
>
{this.props.enableGradient && (
Expand Down Expand Up @@ -1005,7 +1005,7 @@ export class VerticalBarChartBase
const gradientId = getId('VBC_Gradient') + `_${index}_${startColor}`;

return (
<g key={point.x instanceof Date ? point.x.getTime() : point.x}>
<g key={point.x instanceof Date ? `${point.x.getTime()}_${index}` : `${point.x}_${index}`}>
{this.props.enableGradient && (
<defs>
<linearGradient id={gradientId} x1="0%" y1="100%" x2="0%" y2="0%">
Expand Down

0 comments on commit ab504b1

Please sign in to comment.