MCPcopy
hub / github.com/reactchartjs/react-chartjs-2 / renderChart

Function renderChart

src/chart.tsx:38–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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);

Callers 1

ChartComponentFunction · 0.85

Calls 2

cloneDataFunction · 0.85
reforwardRefFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…