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
prepDataPrepData | undefined
scaleKeys[string, string]

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()
getStackingGroups()
getTooltipInterpolator()
hasSync()
setCursor(cursor)
setMode(mode)
setPadding(padding)
setPrepData(prepData)
setSelect(select)
setStackingGroups(groups)
setSync()
setTooltipInterpolator(interpolator)

constructor(timeZone)

Constructs a new instance of the UPlotConfigBuilder class

Signature

typescript
constructor(timeZone?: TimeZone);

Parameters

ParameterTypeDescription
timeZoneTimeZone

prepData property

Signature

typescript
prepData: PrepData | undefined;

scaleKeys property

Signature

typescript
scaleKeys: [string, string];

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[]

getStackingGroups method

Signature

typescript
getStackingGroups(): StackingGroup[];

Returns:

StackingGroup[]

getTooltipInterpolator method

Signature

typescript
getTooltipInterpolator(): PlotTooltipInterpolator | undefined;

Returns:

PlotTooltipInterpolator | undefined

hasSync method

Signature

typescript
hasSync(): boolean;

Returns:

boolean

setCursor method

Signature

typescript
setCursor(cursor?: Cursor): void;

Parameters

ParameterTypeDescription
cursorCursor

Returns:

void

setMode method

Signature

typescript
setMode(mode: uPlot.Mode): void;

Parameters

ParameterTypeDescription
modeuPlot.Mode

Returns:

void

setPadding method

Signature

typescript
setPadding(padding: Padding): void;

Parameters

ParameterTypeDescription
paddingPadding

Returns:

void

setPrepData method

Signature

typescript
setPrepData(prepData: PreDataStacked): void;

Parameters

ParameterTypeDescription
prepDataPreDataStacked

Returns:

void

setSelect method

Signature

typescript
setSelect(select: Select): void;

Parameters

ParameterTypeDescription
selectSelect

Returns:

void

setStackingGroups method

Signature

typescript
setStackingGroups(groups: StackingGroup[]): void;

Parameters

ParameterTypeDescription
groupsStackingGroup[]

Returns:

void

setSync method

Signature

typescript
setSync(): void;

Returns:

void

setTooltipInterpolator method

Signature

typescript
setTooltipInterpolator(interpolator: PlotTooltipInterpolator): void;

Parameters

ParameterTypeDescription
interpolatorPlotTooltipInterpolator

Returns:

void