Skip to content

Commit

Permalink
fix pie chart multiple colors changed (re getredash#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
alison985 authored and Allen Short committed Dec 12, 2017
1 parent 546a7b5 commit 15104f8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/app/visualizations/chart/chart-editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ <h4>{{$index == 0 ? 'Left' : 'Right'}} Y Axis</h4>
<th>Color</th>
</thead>
<tbody ui-sortable ng-model="form.colorsList">
<tr ng-repeat="name in form.colorsList">
<tr ng-repeat="name in form.colorsList track by name">
<td style="cursor: move;"><i class="fa fa-arrows-v"></i> <span
ng-bind="options.seriesOptions[name].zIndex + 1"></span>
</td>
Expand Down
6 changes: 5 additions & 1 deletion client/app/visualizations/chart/plotly.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,11 @@ 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 15104f8

Please sign in to comment.