import { Switch } from '@patternfly/react-core'; import { ChartPie, ChartThemeColor } from '@patternfly/react-charts/victory'; import { useState } from 'react'; interface PetData { name?: string; x?: string; y?: number; } export const SkeletonsPieChart: React.FunctionComponent = () => { const [isChecked, setIsChecked] = useState(true); const handleChange = (_event: React.FormEvent, checked: boolean) => { setIsChecked(checked); }; const data: PetData[] = [ { x: 'Cats', y: 35 }, { x: 'Dogs', y: 55 }, { x: 'Birds', y: 10 } ]; const legendData: PetData[] = [{ name: 'Cats: 35' }, { name: 'Dogs: 55' }, { name: 'Birds: 10' }]; return ( <>
`${datum.x}: ${datum.y}`} legendData={legendData} legendOrientation="vertical" legendPosition="right" name="chart9" padding={{ bottom: 20, left: 20, right: 140, // Adjusted to accommodate legend top: 20 }} themeColor={isChecked ? ChartThemeColor.skeleton : ChartThemeColor.blue} width={350} />
); };