Commit 68ad93f4 by Torkel Ödegaard Committed by GitHub

Gauge: Fix switching orientation issue when switching from BarGauge to Gauge (#17064)

parent 3df94c6f
......@@ -76,7 +76,7 @@ export class Gauge extends PureComponent<Props> {
);
const gaugeWidthReduceRatio = showThresholdLabels ? 1.5 : 1;
const gaugeWidth = Math.min(dimension / 5, 40) / gaugeWidthReduceRatio;
const gaugeWidth = Math.min(dimension / 5.5, 40) / gaugeWidthReduceRatio;
const thresholdMarkersWidth = gaugeWidth / 5;
const fontSize = Math.min(dimension / 5.5, 100) * (value.text !== null ? this.getFontScale(value.text.length) : 1);
const thresholdLabelFontSize = fontSize / 2.5;
......
......@@ -5,7 +5,7 @@ import React, { PureComponent } from 'react';
import { config } from 'app/core/config';
// Components
import { Gauge, FieldDisplay, getFieldDisplayValues } from '@grafana/ui';
import { Gauge, FieldDisplay, getFieldDisplayValues, VizOrientation } from '@grafana/ui';
// Types
import { GaugeOptions } from './types';
......@@ -43,7 +43,7 @@ export class GaugePanel extends PureComponent<PanelProps<GaugeOptions>> {
};
render() {
const { height, width, options, data, renderCounter } = this.props;
const { height, width, data, renderCounter } = this.props;
return (
<VizRepeater
getValues={this.getValues}
......@@ -52,7 +52,7 @@ export class GaugePanel extends PureComponent<PanelProps<GaugeOptions>> {
height={height}
source={data}
renderCounter={renderCounter}
orientation={options.orientation}
orientation={VizOrientation.Auto}
/>
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment