Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nvd3] fix single metric showing up in legend #3563

Merged
merged 1 commit into from
Oct 2, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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