mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
Fix bug with breakdown (#2312)
* Fix bug with breakdown * allow distribution graph to scroll horizontally * don't stringify i
This commit is contained in:
parent
4e848c8cb5
commit
266c049f2d
@ -11,7 +11,7 @@ text.nv-axislabel {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.dist_bar .slice_container {
|
||||
.dist_bar {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
|
@ -1148,8 +1148,8 @@ class DistributionBarViz(DistributionPieViz):
|
||||
pt = (pt / pt.sum()).T
|
||||
pt = pt.reindex(row.index)
|
||||
chart_data = []
|
||||
for name, ys in df.iteritems():
|
||||
if df[name].dtype.kind not in "biufc" or name in self.groupby:
|
||||
for name, ys in pt.iteritems():
|
||||
if pt[name].dtype.kind not in "biufc" or name in self.groupby:
|
||||
continue
|
||||
if isinstance(name, string_types):
|
||||
series_title = name
|
||||
@ -1159,19 +1159,12 @@ class DistributionBarViz(DistributionPieViz):
|
||||
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": values,
|
||||
"values": [
|
||||
{'x': i, 'y': v}
|
||||
for i, v in ys.iteritems()
|
||||
]
|
||||
}
|
||||
chart_data.append(d)
|
||||
return chart_data
|
||||
|
Loading…
Reference in New Issue
Block a user