diff --git a/superset/assets/javascripts/explore/stores/controls.jsx b/superset/assets/javascripts/explore/stores/controls.jsx index 1fdf868df2..03d1fbddd5 100644 --- a/superset/assets/javascripts/explore/stores/controls.jsx +++ b/superset/assets/javascripts/explore/stores/controls.jsx @@ -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', diff --git a/superset/assets/javascripts/explore/stores/visTypes.js b/superset/assets/javascripts/explore/stores/visTypes.js index 7d3f26284b..7291286a1f 100644 --- a/superset/assets/javascripts/explore/stores/visTypes.js +++ b/superset/assets/javascripts/explore/stores/visTypes.js @@ -337,7 +337,7 @@ export const visTypes = { controlSetRows: [ ['groupby', 'columns'], ['metrics', 'pandas_aggfunc'], - ['number_format'], + ['number_format', 'pivot_margins'], ], }, ], diff --git a/superset/viz.py b/superset/viz.py index 1ae42b369a..6778c3511e 100755 --- a/superset/viz.py +++ b/superset/viz.py @@ -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),