2020-04-06 09:24:41 -05:00
|
|
|
import { PanelPlugin } from '@grafana/data';
|
2019-03-08 04:42:41 -06:00
|
|
|
import { PieChartPanel } from './PieChartPanel';
|
2020-04-08 12:21:26 -05:00
|
|
|
import { PieChartOptions } from './types';
|
|
|
|
import { addStandardDataReduceOptions } from '../stat/types';
|
|
|
|
import { PieChartType } from '@grafana/ui';
|
2019-02-15 11:43:51 -06:00
|
|
|
|
2021-01-20 00:59:48 -06:00
|
|
|
export const plugin = new PanelPlugin<PieChartOptions>(PieChartPanel).setPanelOptions((builder) => {
|
2020-04-08 12:21:26 -05:00
|
|
|
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,
|
|
|
|
});
|
|
|
|
});
|