Skip to content

Commit

Permalink
Keep order of axis data when storing df (#2092)
Browse files Browse the repository at this point in the history
  • Loading branch information
vera-liu authored Feb 10, 2017
1 parent 2d910e3 commit b16930f
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -1354,18 +1354,16 @@ def to_series(self, df, classed=''):
series = df.to_dict('series')
chart_data = []
index_list = df.T.index.tolist()
for i in range(0, len(index_list)):
name = index_list[i]
ys = series[name]
if df[name].dtype.kind not in "biufc":
metrics = [
self.form_data.get('metric'),
self.form_data.get('metric_2')
]
for i, m in enumerate(metrics):
ys = series[m]
if df[m].dtype.kind not in "biufc":
continue
df[DTTM_ALIAS] = pd.to_datetime(df.index, utc=False)
if isinstance(name, string_types):
series_title = name
else:
name = ["{}".format(s) for s in name]
series_title = ", ".join(name[1:])

series_title = m
d = {
"key": series_title,
"classed": classed,
Expand Down

0 comments on commit b16930f

Please sign in to comment.