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.
UPlotConfigBuilder class
Signature
export declare class UPlotConfigBuilder Import
import { UPlotConfigBuilder } from '@grafana/ui';Constructors
| Constructor | Modifiers | Description |
|---|---|---|
| constructor(timeZone) | Constructs a new instance of the UPlotConfigBuilder class |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| scaleKeys | [string, string] | ||
| tooltipInterpolator | PlotTooltipInterpolator | undefined | Custom handler for closest datapoint and series lookup. Technicaly returns uPlots setCursor hook that sets tooltips state. |
Methods
| Method | Modifiers | Description |
|---|---|---|
| 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
constructor(timeZone?: TimeZone);Parameters
| Parameter | Type | Description |
|---|---|---|
| timeZone | TimeZone |
scaleKeys property
Signature
scaleKeys: [string, string];tooltipInterpolator property
Custom handler for closest datapoint and series lookup. Technicaly returns uPlots setCursor hook that sets tooltips state.
Signature
tooltipInterpolator: PlotTooltipInterpolator | undefined;addAxis method
Signature
addAxis(props: AxisProps): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| props | AxisProps |
Returns:
void
addBand method
Signature
addBand(band: Band): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| band | Band |
Returns:
void
addHook method
Signature
addHook<T extends keyof Hooks.Defs>(type: T, hook: Hooks.Defs[T]): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| type | T | |
| hook | Hooks.Defs[T] |
Returns:
void
addScale method
Add or update the scale with the scale key
Signature
addScale(props: ScaleProps): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| props | ScaleProps |
Returns:
void
addSeries method
Signature
addSeries(props: SeriesProps): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| props | SeriesProps |
Returns:
void
addThresholds method
Signature
addThresholds(options: UPlotThresholdOptions): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| options | UPlotThresholdOptions |
Returns:
void
getAxisPlacement method
Signature
getAxisPlacement(scaleKey: string): AxisPlacement;Parameters
| Parameter | Type | Description |
|---|---|---|
| scaleKey | string |
Returns:
AxisPlacement
getConfig method
Signature
getConfig(): PlotConfig;Returns:
PlotConfig
getSeries method
Signature
getSeries(): UPlotSeriesBuilder[];Returns:
UPlotSeriesBuilder[]
hasSync method
Signature
hasSync(): boolean;Returns:
boolean
setCursor method
Signature
setCursor(cursor?: Cursor): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| cursor | Cursor |
Returns:
void
setSelect method
Signature
setSelect(select: Select): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| select | Select |
Returns:
void
setStacking method
Signature
setStacking(enabled?: boolean): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| enabled | boolean |
Returns:
void
setSync method
Signature
setSync(): void;Returns:
void
setTooltipInterpolator method
Signature
setTooltipInterpolator(interpolator: PlotTooltipInterpolator): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| interpolator | PlotTooltipInterpolator |
Returns:
void



