Skip to content

Commit

Permalink
fix(charts): Repeat the color palette if more datasets than colors ar…
Browse files Browse the repository at this point in the history
…e used (#86)
  • Loading branch information
Lukas742 authored and MarcusNotheis committed Aug 8, 2019
1 parent 14d277d commit e22387c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/charts/src/util/populateData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export const populateData = (labels, datasets, colors, theme, isPie = false) =>
return {
labels,
datasets: datasets.map((item, index) => ({
backgroundColor: isPie ? colorPalette : colorPalette[index],
borderColor: isPie ? colorPalette : colorPalette[index],
backgroundColor: isPie ? colorPalette : colorPalette[index % colorPalette.length],
borderColor: isPie ? colorPalette : colorPalette[index % colorPalette.length],
...item
}))
};
Expand Down

0 comments on commit e22387c

Please sign in to comment.