Home Forums Chart Support Cannot read properties of undefined (reading ‘getTime’)

Cannot read properties of undefined (reading ‘getTime’)

Viewing 2 posts - 1 through 2 (of 2 total)
  • #41679

    I’m facing issue while adding dataPoints dynamically in Canvasjs.

    Im adding my code below,

    function BindChart(xAxis, secXAxis) {
                    var obj1 = JSON.parse(JSON.stringify(xAxis));
                    var obj2 = JSON.parse(JSON.stringify(secXAxis));
    
                    var obj3 = '[' + obj1 + ']';
    		//var obj4 = '[' + obj2 + ']';
    
                    var final = obj3;
    
                    //console.log('{ x: 2019, y: 2.30, label: "2019" },{ x: 2020, y: 5.60, label: "2020" },{ x: 2021, y: 3.50, label: "2021" },');
    
                    console.log(obj1);
                    console.log(obj2);
                    console.log(obj3);
    
                    var chart = new CanvasJS.Chart("chartContainer",
                        {
                            title: {
                                text: "A Combination of Column & Line Chart"
    
                            },
                            axisY: {
                                minimum: 0
                            },
                            data: [{
                                type: "column",
                                dataPoints: final
                            },
                               
    
                            ]
                        });
    
                    chart.render();
                }

    so please help me.`

    #41690

    @edwin-k-biju,

    Can you kindly create JSFiddle reproducing the issue you are facing & share it with us so that we can look into it, understand the scenario better and help you out? We are unable to reproduce the issue as values of xAxis, secXAxis are not known.


    Vishwas R
    Team CanvasJS

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

You must be logged in to reply to this topic.