mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Add orientation prop to Gauge panel (#39682)
This commit is contained in:
parent
9a178e7ba9
commit
0bb426ec33
@ -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<PanelProps<GaugeOptions>> {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { height, width, data, renderCounter } = this.props;
|
||||
const { height, width, data, renderCounter, options } = this.props;
|
||||
|
||||
return (
|
||||
<VizRepeater
|
||||
getValues={this.getValues}
|
||||
@ -73,7 +74,7 @@ export class GaugePanel extends PureComponent<PanelProps<GaugeOptions>> {
|
||||
source={data}
|
||||
autoGrid={true}
|
||||
renderCounter={renderCounter}
|
||||
orientation={VizOrientation.Auto}
|
||||
orientation={options.orientation}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -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<GaugeOptions>(GaugePanel)
|
||||
.useFieldConfig()
|
||||
.setPanelOptions((builder) => {
|
||||
addStandardDataReduceOptions(builder);
|
||||
addOrientationOption(builder);
|
||||
|
||||
builder
|
||||
.addBooleanSwitch({
|
||||
|
Loading…
Reference in New Issue
Block a user