mirror of
https://github.com/grafana/grafana.git
synced 2026-07-29 15:59:50 -05:00
Makes pie chart component accept data frames (#32829)
* Makes pie chart component accept dataframes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React, { useCallback } from 'react';
|
||||
import { PieChart, useTheme } from '@grafana/ui';
|
||||
import { PieChart } from '@grafana/ui';
|
||||
import { PieChartOptions } from './types';
|
||||
import { getFieldDisplayValues, PanelProps } from '@grafana/data';
|
||||
import { PanelProps } from '@grafana/data';
|
||||
import { changeSeriesColorConfigFactory } from '../timeseries/overrides/colorSeriesConfigFactory';
|
||||
|
||||
interface Props extends PanelProps<PieChartOptions> {}
|
||||
@@ -23,20 +23,15 @@ export const PieChartPanel: React.FC<Props> = ({
|
||||
[fieldConfig, onFieldConfigChange]
|
||||
);
|
||||
|
||||
const fieldDisplayValues = getFieldDisplayValues({
|
||||
fieldConfig,
|
||||
reduceOptions: options.reduceOptions,
|
||||
data: data.series,
|
||||
theme: useTheme(),
|
||||
replaceVariables: replaceVariables,
|
||||
timeZone,
|
||||
});
|
||||
|
||||
return (
|
||||
<PieChart
|
||||
width={width}
|
||||
height={height}
|
||||
fieldDisplayValues={fieldDisplayValues}
|
||||
timeZone={timeZone}
|
||||
fieldConfig={fieldConfig}
|
||||
reduceOptions={options.reduceOptions}
|
||||
replaceVariables={replaceVariables}
|
||||
data={data.series}
|
||||
onSeriesColorChange={onSeriesColorChange}
|
||||
pieType={options.pieType}
|
||||
displayLabels={options.displayLabels}
|
||||
|
||||
Reference in New Issue
Block a user