mirror of
https://github.com/grafana/grafana.git
synced 2026-07-30 08:18:10 -05:00
Stat: Disable wide layout (#75556)
update stat panel to disable the wide layout
This commit is contained in:
@@ -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<Props> {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -48,6 +48,7 @@ export class StatPanel extends PureComponent<PanelProps<Options>> {
|
||||
theme={config.theme2}
|
||||
onClick={openMenu}
|
||||
className={targetClassName}
|
||||
disableWideLayout={true}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user