2 years ago

#75131

test-img

Jonathan Ludeña

How can I export to image a Chart with react-chartjs-2 and add logo or whatever stuff in image?

I need to export to image a Chart with react-chartjs-2 and add logo or whatever stuff in image.

I'm doing this

    const exportImage = useCallback(() => {
        const link = document.createElement("a");
        link.download = `Chart${today}.png`;
        link.href = refChart.current.toBase64Image();
        link.click();
      }, [refChart]);

But don't works! error: toBase64Image is not a function My component is a Div but that Div have logos and chart

Please you help! Thanks

reactjs

typescript

charts

react-chartjs-2

0 Answers

Your Answer

Accepted video resources