import { ChartDonutThreshold, ChartDonutUtilization } from '@patternfly/react-charts/victory'; import { useEffect, useState } from 'react'; interface UsageData { x?: string; y?: number; name?: string; } export const ChartUtilInvertedStatic: React.FunctionComponent = () => { const [used, setUsed] = useState(100); useEffect(() => { const interval = setInterval(() => { setUsed((prevUsed) => { const val = (prevUsed - 10 + 100) % 100; return val; }); }, 1000); return () => clearInterval(interval); }, []); const dataThreshold: UsageData[] = [ { x: 'Warning at 60%', y: 60 }, { x: 'Danger at 20%', y: 20 } ]; const dataUtil: UsageData = { x: 'Storage capacity', y: used }; const legendData: UsageData[] = [ { name: `Storage capacity: ${used}%` }, { name: 'Warning threshold at 60%' }, { name: 'Danger threshold at 20%' } ]; return (