mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Add datalinks support to PieChart v2 (#31642)
* Remove default value for multiSelect * Add data links support for PieChart v2 * Temporarily fix story * Refactor PieSlice, deduplicate colors * Add field config to context menu of pie chart * Add custom key to legend This is a bit hacky. When there are multiple DisplayValues with the same title the react keys collide and LegendListItems are not cleared correctly. * Forgot to add the interface * Fix missing tooltip in edit mode
This commit is contained in:
@@ -23,20 +23,20 @@ export const PieChartPanel: React.FC<Props> = ({
|
||||
[fieldConfig, onFieldConfigChange]
|
||||
);
|
||||
|
||||
const values = getFieldDisplayValues({
|
||||
const fieldDisplayValues = getFieldDisplayValues({
|
||||
fieldConfig,
|
||||
reduceOptions: options.reduceOptions,
|
||||
data: data.series,
|
||||
theme: useTheme(),
|
||||
replaceVariables: replaceVariables,
|
||||
timeZone,
|
||||
}).map((v) => v.display);
|
||||
});
|
||||
|
||||
return (
|
||||
<PieChart
|
||||
width={width}
|
||||
height={height}
|
||||
values={values}
|
||||
fieldDisplayValues={fieldDisplayValues}
|
||||
onSeriesColorChange={onSeriesColorChange}
|
||||
pieType={options.pieType}
|
||||
displayLabels={options.displayLabels}
|
||||
|
||||
Reference in New Issue
Block a user