()
| 36 | const chartRef = useRef<ChartJS<TType, TData, TLabel> | null>(null); |
| 37 | |
| 38 | const renderChart = () => { |
| 39 | if (!canvasRef.current) return; |
| 40 | |
| 41 | chartRef.current = new ChartJS(canvasRef.current, { |
| 42 | type, |
| 43 | data: cloneData(data, datasetIdKey), |
| 44 | options: options && { ...options }, |
| 45 | plugins, |
| 46 | }); |
| 47 | |
| 48 | reforwardRef(ref, chartRef.current); |
| 49 | }; |
| 50 | |
| 51 | const destroyChart = () => { |
| 52 | reforwardRef(ref, null); |
no test coverage detected
searching dependent graphs…