diff --git a/public/app/plugins/panel/gauge/GaugePanel.tsx b/public/app/plugins/panel/gauge/GaugePanel.tsx index 54a09983a3c..950ae77e762 100644 --- a/public/app/plugins/panel/gauge/GaugePanel.tsx +++ b/public/app/plugins/panel/gauge/GaugePanel.tsx @@ -1,5 +1,5 @@ import React, { PureComponent } from 'react'; -import { FieldDisplay, getFieldDisplayValues, PanelProps, VizOrientation } from '@grafana/data'; +import { FieldDisplay, getFieldDisplayValues, PanelProps } from '@grafana/data'; import { DataLinksContextMenu, Gauge, VizRepeater, VizRepeaterRenderValueProps } from '@grafana/ui'; import { DataLinksContextMenuApi } from '@grafana/ui/src/components/DataLinks/DataLinksContextMenu'; @@ -63,7 +63,8 @@ export class GaugePanel extends PureComponent> { }; render() { - const { height, width, data, renderCounter } = this.props; + const { height, width, data, renderCounter, options } = this.props; + return ( > { source={data} autoGrid={true} renderCounter={renderCounter} - orientation={VizOrientation.Auto} + orientation={options.orientation} /> ); } diff --git a/public/app/plugins/panel/gauge/module.tsx b/public/app/plugins/panel/gauge/module.tsx index cecedb65132..5658c9d4569 100644 --- a/public/app/plugins/panel/gauge/module.tsx +++ b/public/app/plugins/panel/gauge/module.tsx @@ -1,7 +1,7 @@ import { PanelPlugin } from '@grafana/data'; import { GaugePanel } from './GaugePanel'; import { GaugeOptions } from './types'; -import { addStandardDataReduceOptions } from '../stat/types'; +import { addOrientationOption, addStandardDataReduceOptions } from '../stat/types'; import { gaugePanelMigrationHandler, gaugePanelChangedHandler } from './GaugeMigrations'; import { commonOptionsBuilder } from '@grafana/ui'; @@ -9,6 +9,7 @@ export const plugin = new PanelPlugin(GaugePanel) .useFieldConfig() .setPanelOptions((builder) => { addStandardDataReduceOptions(builder); + addOrientationOption(builder); builder .addBooleanSwitch({