Skip to content

Commit

Permalink
Fixing up color bugs. wireservice#26
Browse files Browse the repository at this point in the history
  • Loading branch information
nbedi committed Jun 15, 2016
1 parent 8e825f1 commit 8d35f8a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions leather/shapes/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def legend_dimension(self):

def legend_labels(self, series, palette):
"""
Generate a dictionary of labels mappeds to colors for the legend.
Generate a list of tuples with labels mappeds to colors for the legend.
"""
label_colors = []
legend_dimension = self._legend_dimension
Expand Down Expand Up @@ -50,7 +50,12 @@ def legend_to_svg(self, series, palette):
"""
Render the legend entries for these shapes.
"""
label_colors = self.legend_labels(series, palette)
if self._fill_color is not None:
colors = self._fill_color
else:
colors = list(palette)

label_colors = self.legend_labels(series, colors)
item_groups = []

if hasattr(self, '_stroke_color'):
Expand Down
2 changes: 1 addition & 1 deletion leather/shapes/grouped_bars.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def validate_series(self, series):
"""
Verify this shape can be used to render a given series.
"""
if isinstance(series, CategorySeries):
if not isinstance(series, CategorySeries):
raise ValueError('GroupedBars can only be used to render CategorySeries.')

def to_svg(self, width, height, x_scale, y_scale, series, palette):
Expand Down

0 comments on commit 8d35f8a

Please sign in to comment.