Skip to content

Commit 3df714d

Browse files
authored
Merge pull request #241 from alison985/204_fix_unable_to_save
make pie chart colors work w/o having to choose each color.
2 parents 17ba8e7 + 6e9170c commit 3df714d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

client/app/visualizations/chart/plotly.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,12 @@ const PlotlyChart = () => {
273273
series.data.forEach((row) => {
274274
plotlySeries.values.push(row.y);
275275
plotlySeries.labels.push(hasX ? row.x : `Slice ${index}`);
276-
plotlySeries.marker.colors.push(scope.options.seriesOptions[hasX ? row.x : `Slice ${index}`].color);
276+
if (scope.options.seriesOptions[hasX ? row.x : `Slice ${index}`] === undefined) {
277+
plotlySeries.marker.colors.push(getColor(index));
278+
index += 1;
279+
} else {
280+
plotlySeries.marker.colors.push(scope.options.seriesOptions[hasX ? row.x : `Slice ${index}`].color);
281+
}
277282
});
278283

279284
scope.data.push(plotlySeries);

0 commit comments

Comments
 (0)