mirror of
https://github.com/grafana/grafana.git
synced 2026-09-05 04:40:13 -05:00
* Remove deprecated setDefault usages * Add simple support for conditinal field config properties * Use new API in NewsPanel * Update tests * Fix check
30 lines
897 B
TypeScript
30 lines
897 B
TypeScript
import { PanelPlugin } from '@grafana/data';
|
|
import { PieChartPanel } from './PieChartPanel';
|
|
import { PieChartOptions } from './types';
|
|
import { addStandardDataReduceOptions } from '../stat/types';
|
|
import { PieChartType } from '@grafana/ui';
|
|
|
|
export const plugin = new PanelPlugin<PieChartOptions>(PieChartPanel).setPanelOptions(builder => {
|
|
addStandardDataReduceOptions(builder, false);
|
|
|
|
builder
|
|
.addRadio({
|
|
name: 'Piechart type',
|
|
description: 'How the piechart should be rendered',
|
|
path: 'pieType',
|
|
settings: {
|
|
options: [
|
|
{ value: PieChartType.PIE, label: 'Pie' },
|
|
{ value: PieChartType.DONUT, label: 'Donut' },
|
|
],
|
|
},
|
|
defaultValue: PieChartType.PIE,
|
|
})
|
|
.addNumberInput({
|
|
name: 'Width',
|
|
description: 'Width of the piechart outline',
|
|
path: 'strokeWidth',
|
|
defaultValue: 1,
|
|
});
|
|
});
|