Menu

Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.

Enterprise Open source

Gauge class

Signature

typescript
export declare class Gauge extends PureComponent<Props> 

Import

typescript
import { Gauge } from '@grafana/ui';

Properties

PropertyModifiersTypeDescription
canvasElementany
defaultPropsstaticPartial<Props>
renderVisualization() => JSX.Element

Methods

MethodModifiersDescription
componentDidMount()
componentDidUpdate()
draw()
getFontScale(length)
getFormattedThresholds(decimals)
render()

canvasElement property

Signature

typescript
canvasElement: any;

defaultProps property

Signature

typescript
static defaultProps: Partial<Props>;

renderVisualization property

Signature

typescript
renderVisualization: () => JSX.Element;

componentDidMount method

Signature

typescript
componentDidMount(): void;

Returns:

void

componentDidUpdate method

Signature

typescript
componentDidUpdate(): void;

Returns:

void

draw method

Signature

typescript
draw(): void;

Returns:

void

getFontScale method

Signature

typescript
getFontScale(length: number): number;

Parameters

ParameterTypeDescription
lengthnumber

Returns:

number

getFormattedThresholds method

Signature

typescript
getFormattedThresholds(decimals: number): Threshold[];

Parameters

ParameterTypeDescription
decimalsnumber

Returns:

Threshold[]

render method

Signature

typescript
render(): JSX.Element;

Returns:

JSX.Element