import React, { useEffect, useRef } from 'react' import { CChartLine } from '@coreui/react-chartjs' import { getStyle } from '@coreui/utils' const MainChart = () => { const chartRef = useRef(null) useEffect(() => { const handleColorSchemeChange = () => { if (chartRef.current) { setTimeout(() => { chartRef.current.options.scales.x.grid.borderColor = getStyle( '--cui-border-color-translucent', ) chartRef.current.options.scales.x.grid.color = getStyle('--cui-border-color-translucent') chartRef.current.options.scales.x.ticks.color = getStyle('--cui-body-color') chartRef.current.options.scales.y.grid.borderColor = getStyle( '--cui-border-color-translucent', ) chartRef.current.options.scales.y.grid.color = getStyle('--cui-border-color-translucent') chartRef.current.options.scales.y.ticks.color = getStyle('--cui-body-color') chartRef.current.update() }) } } document.documentElement.addEventListener('ColorSchemeChange', handleColorSchemeChange) return () => document.documentElement.removeEventListener('ColorSchemeChange', handleColorSchemeChange) }, [chartRef]) const random = (min = 0, max = 100) => Math.floor(Math.random() * (max - min + 1)) + min return ( <> ) } export default MainChart