import { ChartLabel, ChartLegend, ChartPie, ChartThemeColor } from '@patternfly/react-charts/victory';
import { Tooltip } from '@patternfly/react-core';
import { useRef } from 'react';
interface PetData {
x: string;
y: number;
}
export const ChartLegendTooltips: React.FunctionComponent = () => {
const data: PetData[] = [
{ x: 'Cats', y: 35 },
{ x: 'Dogs', y: 55 },
{ x: 'Birds', y: 10 }
];
// Custom legend label component
// Note: Tooltip wraps children with a div tag, so we use a reference to ChartLabel instead
const LegendLabel = ({ datum, ...rest }) => {
const ref = useRef(null);
return (