grafana/public/app/plugins/panel/piechart/module.tsx

30 lines
899 B
TypeScript
Raw Normal View History

import { PanelPlugin } from '@grafana/data';
2019-03-08 04:42:41 -06:00
import { PieChartPanel } from './PieChartPanel';
import { PieChartOptions } from './types';
import { addStandardDataReduceOptions } from '../stat/types';
import { PieChartType } from '@grafana/ui';
2019-02-15 11:43:51 -06:00
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,
});
});