Skip to content

Commit

Permalink
make pie chart colors work w/o having to choose each color.
Browse files Browse the repository at this point in the history
  • Loading branch information
alison985 committed Aug 31, 2017
1 parent ac19420 commit e71533b
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 e71533b

Please sign in to comment.