Skip to content

Commit

Permalink
Merge pull request #241 from alison985/204_fix_unable_to_save
Browse files Browse the repository at this point in the history
make pie chart colors work w/o having to choose each color.
  • Loading branch information
alison985 authored Sep 1, 2017
2 parents 17ba8e7 + 6e9170c commit 3df714d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion client/app/visualizations/chart/plotly.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,12 @@ const PlotlyChart = () => {
series.data.forEach((row) => {
plotlySeries.values.push(row.y);
plotlySeries.labels.push(hasX ? row.x : `Slice ${index}`);
plotlySeries.marker.colors.push(scope.options.seriesOptions[hasX ? row.x : `Slice ${index}`].color);
if (scope.options.seriesOptions[hasX ? row.x : `Slice ${index}`] === undefined) {
plotlySeries.marker.colors.push(getColor(index));
index += 1;
} else {
plotlySeries.marker.colors.push(scope.options.seriesOptions[hasX ? row.x : `Slice ${index}`].color);
}
});

scope.data.push(plotlySeries);
Expand Down

0 comments on commit 3df714d

Please sign in to comment.