()
| 88 | const theme = useTheme(); |
| 89 | |
| 90 | const initChart = function() { |
| 91 | Chart.register(...registerables); |
| 92 | // Register for Zoom Plugin |
| 93 | Chart.register(zoomPlugin); |
| 94 | let chartContext = chartRef.current.getContext('2d'); |
| 95 | chartObj.current = new Chart(chartContext, { |
| 96 | type: type, |
| 97 | data: data, |
| 98 | plugins: [plugins], |
| 99 | options: options, |
| 100 | }); |
| 101 | props.onInit?.(chartObj.current); |
| 102 | }; |
| 103 | |
| 104 | const destroyChart = function() { |
| 105 | chartObj.current?.resetZoom?.(); |