Skip to content

Commit

Permalink
[nvd3] fix single metric showing up in legend (#3563)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored Oct 2, 2017
1 parent bc3ad64 commit b39d165
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,9 +884,15 @@ def to_series(self, df, classed='', title_suffix=''):
if df[name].dtype.kind not in "biufc":
continue
series_title = name
if (
isinstance(series_title, (list, tuple)) and
len(series_title) > 1 and
len(self.metrics) == 1):
# Removing metric from series name if only one metric
series_title = series_title[1:]
if isinstance(series_title, string_types):
series_title += title_suffix
elif title_suffix and isinstance(series_title, list):
elif title_suffix and isinstance(series_title, (list, tuple)):
series_title.append(title_suffix)

d = {
Expand Down

0 comments on commit b39d165

Please sign in to comment.