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

  1. export interface SetFieldConfigOptionsArgs<TFieldConfigOptions = any>

Import

  1. 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

  1. disableStandardOptions?: FieldConfigProperty[];

Example

  1. {
  2. disableStandardOptions: [FieldConfigProperty.Min, FieldConfigProperty.Max, FieldConfigProperty.Unit]
  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.

standardOptions property

Configuration object of the standard field config properites

Signature

  1. standardOptions?: Partial<Record<FieldConfigProperty, StandardOptionConfig>>;

Example

  1. {
  2. standardOptions: {
  3. [FieldConfigProperty.Decimals]: {
  4. defaultValue: 3
  5. }
  6. }
  7. }

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

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

Example

  1. useCustomConfig: builder => {
  2. builder
  3. .addNumberInput({
  4. id: 'shapeBorderWidth',
  5. name: 'Border width',
  6. description: 'Border width of the shape',
  7. settings: {
  8. min: 1,
  9. max: 5,
  10. },
  11. })
  12. .addSelect({
  13. id: 'displayMode',
  14. name: 'Display mode',
  15. description: 'How the shape shout be rendered'
  16. settings: {
  17. options: [{value: 'fill', label: 'Fill' }, {value: 'transparent', label: 'Transparent }]
  18. },
  19. })
  20. }