mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
[bugfix] get word_cloud to support complex metrics (#5248)
This commit is contained in:
parent
2f274328ed
commit
5a716e9925
@ -721,14 +721,13 @@ class WordCloudViz(BaseViz):
|
|||||||
|
|
||||||
def query_obj(self):
|
def query_obj(self):
|
||||||
d = super(WordCloudViz, self).query_obj()
|
d = super(WordCloudViz, self).query_obj()
|
||||||
|
|
||||||
d['metrics'] = [self.form_data.get('metric')]
|
|
||||||
d['groupby'] = [self.form_data.get('series')]
|
d['groupby'] = [self.form_data.get('series')]
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def get_data(self, df):
|
def get_data(self, df):
|
||||||
|
fd = self.form_data
|
||||||
# Ordering the columns
|
# Ordering the columns
|
||||||
df = df[[self.form_data.get('series'), self.form_data.get('metric')]]
|
df = df[[fd.get('series'), self.metric_labels[0]]]
|
||||||
# Labeling the columns for uniform json schema
|
# Labeling the columns for uniform json schema
|
||||||
df.columns = ['text', 'size']
|
df.columns = ['text', 'size']
|
||||||
return df.to_dict(orient='records')
|
return df.to_dict(orient='records')
|
||||||
|
Loading…
Reference in New Issue
Block a user