Skip to content

Commit

Permalink
Fixing bar charts x_axis labels (#2280)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored Feb 27, 2017
1 parent d4b59b3 commit f10e453
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -1143,11 +1143,20 @@ def get_data(self, df):
else:
l = [str(s) for s in name[1:]]
series_title = ", ".join(l)
values = []
for i, v in ys.iteritems():
idx = pt.index[i]
if isinstance(idx, (tuple, list)):
idx = ', '.join([str(s) for s in idx])
else:
idx = str(idx)
values.append({
'x': idx,
'y': v,
})
d = {
"key": series_title,
"values": [
{'x': str(i), 'y': v}
for i, v in ys.iteritems()]
"values": values,
}
chart_data.append(d)
return chart_data
Expand Down

0 comments on commit f10e453

Please sign in to comment.