mirror of
https://github.com/grafana/grafana.git
synced 2025-07-31 17:22:09 +08:00

* markup timeseries panel edit * mark up matchers ui * mark up bar chart * mark up stat panel * mark up gauge * mark up bar gauge * mark up table component * mark up pie chart * mark up state timeline * mark up heatmap * mark up status history * mark up histogram * mark up text panel * mark up alert list * mark up dashboard list * mark up news panel * mark up annolist * mark up logs panel * mark up node-graph * mark up traces * mark up trend * mark up xychart * fix build
42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
import { PanelPlugin } from '@grafana/data';
|
|
import { t } from '@grafana/i18n';
|
|
import { commonOptionsBuilder } from '@grafana/ui';
|
|
|
|
import { SeriesEditor } from './SeriesEditor';
|
|
import { XYChartPanel2 } from './XYChartPanel';
|
|
import { getScatterFieldConfig } from './config';
|
|
import { xyChartMigrationHandler } from './migrations';
|
|
import { FieldConfig, defaultFieldConfig, Options } from './panelcfg.gen';
|
|
|
|
export const plugin = new PanelPlugin<Options, FieldConfig>(XYChartPanel2)
|
|
// .setPanelChangeHandler(xyChartChangeHandler)
|
|
.setMigrationHandler(xyChartMigrationHandler)
|
|
.useFieldConfig(getScatterFieldConfig(defaultFieldConfig))
|
|
.setPanelOptions((builder) => {
|
|
const category = [t('xychart.category-xychart', 'XY Chart')];
|
|
builder
|
|
.addRadio({
|
|
path: 'mapping',
|
|
name: t('xychart.name-series-mapping', 'Series mapping'),
|
|
category,
|
|
defaultValue: 'auto',
|
|
settings: {
|
|
options: [
|
|
{ value: 'auto', label: t('xychart.series-mapping-options.label-auto', 'Auto') },
|
|
{ value: 'manual', label: t('xychart.series-mapping-options.label-manual', 'Manual') },
|
|
],
|
|
},
|
|
})
|
|
.addCustomEditor({
|
|
id: 'series',
|
|
path: 'series',
|
|
name: '',
|
|
category,
|
|
editor: SeriesEditor,
|
|
defaultValue: [{}],
|
|
});
|
|
|
|
commonOptionsBuilder.addTooltipOptions(builder, true);
|
|
commonOptionsBuilder.addLegendOptions(builder);
|
|
});
|