mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* kindsys: Adapt to new PanelCfg schema interface * building locally * Remove Panel prefix in cue files * Regenerate * Update imports * fixup! Merge branch 'remove-panel-prefix' into sdboyer/redundant-panelcfg-prefixes * Fix formatting --------- Co-authored-by: Ryan McKinley <ryantxu@gmail.com> Co-authored-by: Tania B <yalyna.ts@gmail.com>
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import { Field, FieldType, PanelPlugin } from '@grafana/data';
|
|
import { commonOptionsBuilder } from '@grafana/ui';
|
|
|
|
import { defaultGraphConfig, getGraphFieldConfig } from '../timeseries/config';
|
|
|
|
import { TrendPanel } from './TrendPanel';
|
|
import { FieldConfig, Options } from './panelcfg.gen';
|
|
import { TrendSuggestionsSupplier } from './suggestions';
|
|
|
|
export const plugin = new PanelPlugin<Options, FieldConfig>(TrendPanel)
|
|
.useFieldConfig(getGraphFieldConfig(defaultGraphConfig))
|
|
.setPanelOptions((builder) => {
|
|
const category = ['X Axis'];
|
|
builder.addFieldNamePicker({
|
|
path: 'xField',
|
|
name: 'X Field',
|
|
description: 'An increasing numeric value',
|
|
category,
|
|
defaultValue: undefined,
|
|
settings: {
|
|
isClearable: true,
|
|
placeholderText: 'First numeric value',
|
|
filter: (field: Field) => field.type === FieldType.number,
|
|
},
|
|
});
|
|
|
|
commonOptionsBuilder.addTooltipOptions(builder);
|
|
commonOptionsBuilder.addLegendOptions(builder);
|
|
})
|
|
.setSuggestionsSupplier(new TrendSuggestionsSupplier());
|
|
//.setDataSupport({ annotations: true, alertStates: true });
|