Here is my code :
import * as CanvasJSReact from '../../lib/canvasjs.react';
//var CanvasJSReact = require('./canvasjs.react');
var CanvasJS = CanvasJSReact.CanvasJS;
var CanvasJSChart = CanvasJSReact.CanvasJSChart;
And using it into return function :
render() {
const options = {
title: {
text: "Basic Column Chart in React"
},
data: [{
type: "column",
dataPoints: [
{ label: "Apple", y: 10 },
{ label: "Orange", y: 15 },
{ label: "Banana", y: 25 },
{ label: "Mango", y: 30 },
{ label: "Grape", y: 28 }
]
}]
}
return (
<View>
<ScrollView>
<CanvasJSChart options = {options}
/>
</ScrollView>
</View>
);
}
Its giving me error : Can’t find variable : document
Here is the screenshot :
Let me know what can i do to fix it.
Thanks