Skip to content

Commit

Permalink
Gauge: Fix switching orientation issue when switching from BarGauge t…
Browse files Browse the repository at this point in the history
…o Gauge (grafana#17064)
  • Loading branch information
torkelo authored May 14, 2019
1 parent 3df94c6 commit 68ad93f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/grafana-ui/src/components/Gauge/Gauge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions public/app/plugins/panel/gauge/GaugePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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}
Expand All @@ -52,7 +52,7 @@ export class GaugePanel extends PureComponent<PanelProps<GaugeOptions>> {
height={height}
source={data}
renderCounter={renderCounter}
orientation={options.orientation}
orientation={VizOrientation.Auto}
/>
);
}
Expand Down

0 comments on commit 68ad93f

Please sign in to comment.