0

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

  • maybe try [html2canvas](https://html2canvas.hertzen.com/)... – WhiteHat Jan 20 '22 at 14:28
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jan 29 '22 at 14:32

0 Answers0