Fixes colors in dygraph plotters

This commit is contained in:
Matteo Biscosi 2023-12-15 11:17:31 +00:00
parent 7b8886ad37
commit 42e37fc41d
3 changed files with 12 additions and 2 deletions

View file

@ -45,7 +45,11 @@ function formatSerieColors(palette_list) {
let colors1 = d3v7.schemeCategory10;
colors_list.forEach((s, index) => {
if (s.palette == 0) {
palette_list[index] = colors0[count0 % colors0.length];
if(palette_list.find((element, j) => (element.color === s.color && j !== index))) {
palette_list[index] = colors0[count0 % colors0.length];
} else {
palette_list[index] = s.color;
}
count0 += 1;
} else if (s.palette == 1) {
palette_list[index] = colors1[count1 % colors1.length];