i tried to implement canvasjs react chart with React Typescript (there is now refer page for React Typescript so i followed reactjs refer page) but getting some errors
pl check implemented code below
import CanvasJSReact from './canvasjs-commercial-3.2.16/canvasjs.react';
const Canvas = () => {
const CanvasJS = CanvasJSReact.CanvasJS;
const CanvasJSChart = CanvasJSReact.CanvasJSChart;
const options = {
animationEnabled: true,
theme: "dark2",
title: {
text: "Worpress Featured Plugins"
},
axisY: {
title: "Active Installations",
scaleBreaks: {
autoCalculate: true,
type: "wavy",
lineColor: "white"
}
},
data: [{
type: "column",
indexLabel: "{y}",
indexLabelFontColor: "white",
dataPoints: [
{ "label": "Akismet Anti-Spam", "y": 5000000 },
{ "label": "Jetpack", "y": 4000000 },
{ "label": "WP Super Cache", "y": 2000000 },
{ "label": "bbPress", "y": 300000 },
{ "label": "BuddyPress", "y": 200000 },
{ "label": "Health Check", "y": 200000 }
]
}]
}
return (
<div>
<CanvasJSChart options={options} />
</div>
);
}
export default Canvas;
when i run the project getting ReferenceError: document is not defined error.