Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/BarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class BarChart extends AbstractChart<BarChartProps, BarChartState> {
flatColor: boolean;
}) => {
return data.map((dataset, index) => (
<Defs key={Math.random()}>
<Defs key={dataset.key ?? index}>
{dataset.colors?.map((color, colorIndex) => {
const highOpacityColor = color(1.0);
const lowOpacityColor = color(0.1);
Expand Down
3 changes: 3 additions & 0 deletions src/HelperTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export interface Dataset {

/** Override of LineChart's withScrollableDot property just for this dataset */
withScrollableDot?: boolean;

/** Unique key **/
key?: string | number;
}

export interface ChartData {
Expand Down