From 729300442a090562c0524345b76529ba68b5fefd Mon Sep 17 00:00:00 2001 From: Lukas Date: Thu, 8 Aug 2019 09:14:25 +0200 Subject: [PATCH 1/3] fix(charts): Repeats the color palette at more than twelve datasets --- packages/charts/src/util/populateData.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/charts/src/util/populateData.ts b/packages/charts/src/util/populateData.ts index ca14ba6ddac..65500de6b68 100644 --- a/packages/charts/src/util/populateData.ts +++ b/packages/charts/src/util/populateData.ts @@ -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 % 12], + borderColor: isPie ? colorPalette : colorPalette[index % 12], ...item })) }; From 28fd96adda858493ee33271aeda2f9165e724d52 Mon Sep 17 00:00:00 2001 From: Marcus Notheis Date: Thu, 8 Aug 2019 09:22:50 +0200 Subject: [PATCH 2/3] WIP: Use length of color palette --- packages/charts/src/util/populateData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/charts/src/util/populateData.ts b/packages/charts/src/util/populateData.ts index 65500de6b68..319e0e1e28e 100644 --- a/packages/charts/src/util/populateData.ts +++ b/packages/charts/src/util/populateData.ts @@ -6,7 +6,7 @@ export const populateData = (labels, datasets, colors, theme, isPie = false) => return { labels, datasets: datasets.map((item, index) => ({ - backgroundColor: isPie ? colorPalette : colorPalette[index % 12], + backgroundColor: isPie ? colorPalette : colorPalette[index % colorPalette.length], borderColor: isPie ? colorPalette : colorPalette[index % 12], ...item })) From c30b19a104468d9a196356f6edf84d04fb2b3d2c Mon Sep 17 00:00:00 2001 From: Marcus Notheis Date: Thu, 8 Aug 2019 09:23:01 +0200 Subject: [PATCH 3/3] WIP: Use length of color palette --- packages/charts/src/util/populateData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/charts/src/util/populateData.ts b/packages/charts/src/util/populateData.ts index 319e0e1e28e..d2697a81719 100644 --- a/packages/charts/src/util/populateData.ts +++ b/packages/charts/src/util/populateData.ts @@ -7,7 +7,7 @@ export const populateData = (labels, datasets, colors, theme, isPie = false) => labels, datasets: datasets.map((item, index) => ({ backgroundColor: isPie ? colorPalette : colorPalette[index % colorPalette.length], - borderColor: isPie ? colorPalette : colorPalette[index % 12], + borderColor: isPie ? colorPalette : colorPalette[index % colorPalette.length], ...item })) };