diff --git a/packages/grafana-ui/src/components/BigValue/BigValue.tsx b/packages/grafana-ui/src/components/BigValue/BigValue.tsx index 3019977bf75..762cd2e893b 100644 --- a/packages/grafana-ui/src/components/BigValue/BigValue.tsx +++ b/packages/grafana-ui/src/components/BigValue/BigValue.tsx @@ -74,6 +74,11 @@ export interface Props extends Themeable2 { * Used by BigValueTextMode.Auto text mode. */ count?: number; + + /** + * Disable the wide layout for the BigValue + */ + disableWideLayout?: boolean; } export class BigValue extends PureComponent { diff --git a/packages/grafana-ui/src/components/BigValue/BigValueLayout.tsx b/packages/grafana-ui/src/components/BigValue/BigValueLayout.tsx index 8e52e9f379b..15ff7a04b69 100644 --- a/packages/grafana-ui/src/components/BigValue/BigValueLayout.tsx +++ b/packages/grafana-ui/src/components/BigValue/BigValueLayout.tsx @@ -445,7 +445,7 @@ export class StackedWithNoChartLayout extends BigValueLayout { export function buildLayout(props: Props): BigValueLayout { const { width, height, sparkline } = props; - const useWideLayout = width / height > 2.5; + const useWideLayout = width / height > 2.5 && !props.disableWideLayout; if (useWideLayout) { if (height > 50 && !!sparkline && sparkline.y.values.length > 1) { diff --git a/public/app/plugins/panel/stat/StatPanel.tsx b/public/app/plugins/panel/stat/StatPanel.tsx index 25750a7aaee..2300fc20dcd 100644 --- a/public/app/plugins/panel/stat/StatPanel.tsx +++ b/public/app/plugins/panel/stat/StatPanel.tsx @@ -48,6 +48,7 @@ export class StatPanel extends PureComponent> { theme={config.theme2} onClick={openMenu} className={targetClassName} + disableWideLayout={true} /> ); };