diff --git a/public/app/plugins/panel/piechart/PiechartOptionsBox.tsx b/public/app/plugins/panel/piechart/PiechartOptionsBox.tsx new file mode 100644 index 00000000000..063af8c3379 --- /dev/null +++ b/public/app/plugins/panel/piechart/PiechartOptionsBox.tsx @@ -0,0 +1,47 @@ +// Libraries +import React, { PureComponent } from 'react'; + +// Components +import { Select, FormLabel, PanelOptionsGroup } from '@grafana/ui'; + +// Types +import { FormField, PanelEditorProps } from '@grafana/ui'; +import { PiechartType } from '@grafana/ui'; +import { PiechartOptions } from './types'; + +import * as _ from 'lodash'; + + +const labelWidth = 8; + +const piechartOptions = [ + { value: PiechartType.PIE, label: 'Pie' }, + { value: PiechartType.DONUT, label: 'Donut' }, +]; + +export class PiechartOptionsBox extends PureComponent> { + onPieTypeChange = ({ target }) => this.props.onChange({ ...this.props.options, pieType: target.value }); + onStrokeWidthChange = ({ target }) => this.props.onChange({ ...this.props.options, strokeWidth: target.value }); + + render() { + const { options } = this.props; + const { pieType, strokeWidth } = options; + + return ( + +
+ Type + { value={statOptions.find(option => option.value === stat)} />
-
- Unit - -
); }