mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
Add 'show/hide totals' option to pivot table vis (#3101)
This commit is contained in:
parent
7654eef110
commit
4268513653
@ -218,6 +218,14 @@ export const controls = {
|
|||||||
description: null,
|
description: null,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
pivot_margins: {
|
||||||
|
type: 'CheckboxControl',
|
||||||
|
label: 'Show totals',
|
||||||
|
renderTrigger: false,
|
||||||
|
default: true,
|
||||||
|
description: 'Display total row/column',
|
||||||
|
},
|
||||||
|
|
||||||
show_markers: {
|
show_markers: {
|
||||||
type: 'CheckboxControl',
|
type: 'CheckboxControl',
|
||||||
label: 'Show Markers',
|
label: 'Show Markers',
|
||||||
|
@ -337,7 +337,7 @@ export const visTypes = {
|
|||||||
controlSetRows: [
|
controlSetRows: [
|
||||||
['groupby', 'columns'],
|
['groupby', 'columns'],
|
||||||
['metrics', 'pandas_aggfunc'],
|
['metrics', 'pandas_aggfunc'],
|
||||||
['number_format'],
|
['number_format', 'pivot_margins'],
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -394,7 +394,7 @@ class PivotTableViz(BaseViz):
|
|||||||
columns=self.form_data.get('columns'),
|
columns=self.form_data.get('columns'),
|
||||||
values=self.form_data.get('metrics'),
|
values=self.form_data.get('metrics'),
|
||||||
aggfunc=self.form_data.get('pandas_aggfunc'),
|
aggfunc=self.form_data.get('pandas_aggfunc'),
|
||||||
margins=True,
|
margins=self.form_data.get('pivot_margins'),
|
||||||
)
|
)
|
||||||
return dict(
|
return dict(
|
||||||
columns=list(df.columns),
|
columns=list(df.columns),
|
||||||
|
Loading…
Reference in New Issue
Block a user