mirror of https://github.com/apache/superset.git
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,
|
||||
},
|
||||
|
||||
pivot_margins: {
|
||||
type: 'CheckboxControl',
|
||||
label: 'Show totals',
|
||||
renderTrigger: false,
|
||||
default: true,
|
||||
description: 'Display total row/column',
|
||||
},
|
||||
|
||||
show_markers: {
|
||||
type: 'CheckboxControl',
|
||||
label: 'Show Markers',
|
||||
|
|
|
@ -337,7 +337,7 @@ export const visTypes = {
|
|||
controlSetRows: [
|
||||
['groupby', 'columns'],
|
||||
['metrics', 'pandas_aggfunc'],
|
||||
['number_format'],
|
||||
['number_format', 'pivot_margins'],
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
|
@ -394,7 +394,7 @@ class PivotTableViz(BaseViz):
|
|||
columns=self.form_data.get('columns'),
|
||||
values=self.form_data.get('metrics'),
|
||||
aggfunc=self.form_data.get('pandas_aggfunc'),
|
||||
margins=True,
|
||||
margins=self.form_data.get('pivot_margins'),
|
||||
)
|
||||
return dict(
|
||||
columns=list(df.columns),
|
||||
|
|
Loading…
Reference in New Issue