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.
SetFieldConfigOptionsArgs interface
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Signature
export interface SetFieldConfigOptionsArgs<TFieldConfigOptions = any>
Import
import { SetFieldConfigOptionsArgs } from '@grafana/data';
Properties
Property | Type | Description |
---|---|---|
disableStandardOptions | FieldConfigProperty[] | (BETA) Array of standard field config properties that should not be available in the panel |
standardOptions | Partial<Record<FieldConfigProperty, StandardOptionConfig>> | (BETA) Configuration object of the standard field config properites |
useCustomConfig | (builder: FieldConfigEditorBuilder<TFieldConfigOptions>) => void | (BETA) Function that allows custom field config properties definition. |
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
disableStandardOptions property
Array of standard field config properties that should not be available in the panel
Signature
disableStandardOptions?: FieldConfigProperty[];
Example
{
disableStandardOptions: [FieldConfigProperty.Min, FieldConfigProperty.Max, FieldConfigProperty.Unit]
}
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
standardOptions property
Configuration object of the standard field config properites
Signature
standardOptions?: Partial<Record<FieldConfigProperty, StandardOptionConfig>>;
Example
{
standardOptions: {
[FieldConfigProperty.Decimals]: {
defaultValue: 3
}
}
}
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
useCustomConfig property
Function that allows custom field config properties definition.
Signature
useCustomConfig?: (builder: FieldConfigEditorBuilder<TFieldConfigOptions>) => void;
Example
useCustomConfig: builder => {
builder
.addNumberInput({
id: 'shapeBorderWidth',
name: 'Border width',
description: 'Border width of the shape',
settings: {
min: 1,
max: 5,
},
})
.addSelect({
id: 'displayMode',
name: 'Display mode',
description: 'How the shape shout be rendered'
settings: {
options: [{value: 'fill', label: 'Fill' }, {value: 'transparent', label: 'Transparent }]
},
})
}