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

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

typescript
export interface SetFieldConfigOptionsArgs<TFieldConfigOptions = any> 

Import

typescript
import { SetFieldConfigOptionsArgs } from '@grafana/data';

Properties

PropertyTypeDescription
disableStandardOptionsFieldConfigProperty[](BETA) Array of standard field config properties that should not be available in the panel
standardOptionsPartial<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

typescript
disableStandardOptions?: FieldConfigProperty[];

Example

typescript
{
  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

typescript
standardOptions?: Partial<Record<FieldConfigProperty, StandardOptionConfig>>;

Example

typescript
{
  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

typescript
useCustomConfig?: (builder: FieldConfigEditorBuilder<TFieldConfigOptions>) => void;

Example

typescript
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 }]
   },
 })
}