Home forums Chart Support Trying to implement canvaschart to my react native app , giving error

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #27792

    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 :

    Error Screen

    Let me know what can i do to fix it.

    Thanks

    #27793

    Hi Any body there , who can help me with it ?

    #27806

    @deepaks,

    Can you kindly create sample project reproducing the issue you are facing and share it with us over Google-Drive or Onedrive so that we can look into the code, run it locally at our end to understand the scenario better and help you resolve?


    Vishwas R
    Team CanvasJS

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.