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

UPlotConfigBuilder class

Signature

typescript
export declare class UPlotConfigBuilder 

Import

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

Constructors

ConstructorModifiersDescription
constructor(timeZone)Constructs a new instance of the UPlotConfigBuilder class

Properties

PropertyModifiersTypeDescription
scaleKeys[string, string]
tooltipInterpolatorPlotTooltipInterpolator | undefinedCustom handler for closest datapoint and series lookup. Technicaly returns uPlots setCursor hook that sets tooltips state.

Methods

MethodModifiersDescription
addAxis(props)
addBand(band)
addHook(type, hook)
addScale(props)Add or update the scale with the scale key
addSeries(props)
addThresholds(options)
getAxisPlacement(scaleKey)
getConfig()
getSeries()
hasSync()
setCursor(cursor)
setSelect(select)
setStacking(enabled)
setSync()
setTooltipInterpolator(interpolator)

constructor(timeZone)

Constructs a new instance of the UPlotConfigBuilder class

Signature

typescript
constructor(timeZone?: TimeZone);

Parameters

ParameterTypeDescription
timeZoneTimeZone

scaleKeys property

Signature

typescript
scaleKeys: [string, string];

tooltipInterpolator property

Custom handler for closest datapoint and series lookup. Technicaly returns uPlots setCursor hook that sets tooltips state.

Signature

typescript
tooltipInterpolator: PlotTooltipInterpolator | undefined;

addAxis method

Signature

typescript
addAxis(props: AxisProps): void;

Parameters

ParameterTypeDescription
propsAxisProps

Returns:

void

addBand method

Signature

typescript
addBand(band: Band): void;

Parameters

ParameterTypeDescription
bandBand

Returns:

void

addHook method

Signature

typescript
addHook<T extends keyof Hooks.Defs>(type: T, hook: Hooks.Defs[T]): void;

Parameters

ParameterTypeDescription
typeT
hookHooks.Defs[T]

Returns:

void

addScale method

Add or update the scale with the scale key

Signature

typescript
addScale(props: ScaleProps): void;

Parameters

ParameterTypeDescription
propsScaleProps

Returns:

void

addSeries method

Signature

typescript
addSeries(props: SeriesProps): void;

Parameters

ParameterTypeDescription
propsSeriesProps

Returns:

void

addThresholds method

Signature

typescript
addThresholds(options: UPlotThresholdOptions): void;

Parameters

ParameterTypeDescription
optionsUPlotThresholdOptions

Returns:

void

getAxisPlacement method

Signature

typescript
getAxisPlacement(scaleKey: string): AxisPlacement;

Parameters

ParameterTypeDescription
scaleKeystring

Returns:

AxisPlacement

getConfig method

Signature

typescript
getConfig(): PlotConfig;

Returns:

PlotConfig

getSeries method

Signature

typescript
getSeries(): UPlotSeriesBuilder[];

Returns:

UPlotSeriesBuilder[]

hasSync method

Signature

typescript
hasSync(): boolean;

Returns:

boolean

setCursor method

Signature

typescript
setCursor(cursor?: Cursor): void;

Parameters

ParameterTypeDescription
cursorCursor

Returns:

void

setSelect method

Signature

typescript
setSelect(select: Select): void;

Parameters

ParameterTypeDescription
selectSelect

Returns:

void

setStacking method

Signature

typescript
setStacking(enabled?: boolean): void;

Parameters

ParameterTypeDescription
enabledboolean

Returns:

void

setSync method

Signature

typescript
setSync(): void;

Returns:

void

setTooltipInterpolator method

Signature

typescript
setTooltipInterpolator(interpolator: PlotTooltipInterpolator): void;

Parameters

ParameterTypeDescription
interpolatorPlotTooltipInterpolator

Returns:

void