Uncaught TypeError: Cannot read property 'draw' of undefined

vini
   for (var i = 0; i < reduced.length; i++) {



  var innerdata = [];
  for (var j = 0; j < days.length; j++) {

    var rev = 0;

    _.each(reduced[i].data, function(timerevenueObj) {

      var current = new Date(parseInt(timerevenueObj[0]));
      var daysweek = days[j];

      if (current.toDateString() === daysweek.toDateString()) {
        rev = rev + timerevenueObj[1];
      }



    });

    innerdata.push(rev);


  }




  datasets.push({
    label: reduced[i].label,
    fillColor: "rgba(220,220,220,0.2)",
    strokeColor: "rgba(220,220,220,1)",
    pointColor: "rgba(220,220,220,1)",
    pointStrokeColor: "#fff",
    pointHighlightFill: "#fff",
    pointHighlightStroke: "rgba(220,220,220,1)",
    data: innerdata
  });



 }




 data.push({

    labels: ["May 17","May 18","May 19","May 20","May 21","May 22","May 23","May 24","May 25","May 26","May 27"],
    datasets: datasets

  });

reduced is an array of Objects with the following format:

Channel 1

  CreateTime
  Revenue

  CreateTime
  Revenue

Channel2

 CreateTime
 Revenue

 CreateTime
 Revenue

Format of Data:

enter image description here

I am getting an error when trying to display a Line Chart

Kevin Sandow

Chartjs expects an object, not an array, so use data = {} instead of data.push({}).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Uncaught TypeError: Cannot read property 'toLowerCase' of undefined

From Dev

Uncaught TypeError: Cannot read property 'substr' of undefined

From Dev

Uncaught TypeError: Cannot read property 'createRouteFromReactElement' of undefined

From Dev

Uncaught TypeError: Cannot read property 'ajax' of undefined

From Dev

Uncaught TypeError: Cannot read property 'call' of undefined

From Dev

Uncaught TypeError: Cannot read property 'createDocumentFragment' of undefined

From Dev

Uncaught TypeError: Cannot read property 'addMethod' of undefined

From Java

Uncaught TypeError: Cannot read property 'top' of undefined

From Dev

Uncaught TypeError: Cannot read property 'parentNode' of undefined

From Java

Uncaught TypeError: Cannot read property 'linear' of undefined

From Dev

Uncaught TypeError: Cannot read property 'document' of undefined

From Dev

Uncaught TypeError: Cannot read property 'getZoom' of undefined

From Dev

Uncaught TypeError: Cannot read property 'match' of undefined

From Dev

Uncaught TypeError: Cannot read property 'arrayToDataTable' of undefined

From Dev

Uncaught TypeError: Cannot read property 'createRecord' of undefined

From Dev

Uncaught TypeError: Cannot read property 'login' of undefined

From Dev

Uncaught TypeError: Cannot read property 'children' of undefined

From Dev

Uncaught TypeError: Cannot read property 'LayoutMode' of undefined

From Dev

Uncaught TypeError: Cannot read property 'server' of undefined

From Dev

Uncaught TypeError: Cannot read property 'length' of undefined

From Dev

Uncaught TypeError: Cannot read property 'value' of undefined

From Dev

Uncaught TypeError: Cannot read property 'fn' of undefined

From Dev

Uncaught TypeError: Cannot read property 'message' of undefined

From Dev

Uncaught TypeError: Cannot read property 'scrollHeight' of undefined

From Dev

Uncaught TypeError: Cannot read property 'split' of undefined

From Dev

"Uncaught TypeError: Cannot read property 'people' of undefined "

From Dev

Uncaught TypeError: Cannot read property 'addClass' of undefined

From Dev

Uncaught TypeError: Cannot read property 'success' of undefined

From Dev

Uncaught TypeError: Cannot read property 'substr' of undefined

Related Related

  1. 1

    Uncaught TypeError: Cannot read property 'toLowerCase' of undefined

  2. 2

    Uncaught TypeError: Cannot read property 'substr' of undefined

  3. 3

    Uncaught TypeError: Cannot read property 'createRouteFromReactElement' of undefined

  4. 4

    Uncaught TypeError: Cannot read property 'ajax' of undefined

  5. 5

    Uncaught TypeError: Cannot read property 'call' of undefined

  6. 6

    Uncaught TypeError: Cannot read property 'createDocumentFragment' of undefined

  7. 7

    Uncaught TypeError: Cannot read property 'addMethod' of undefined

  8. 8

    Uncaught TypeError: Cannot read property 'top' of undefined

  9. 9

    Uncaught TypeError: Cannot read property 'parentNode' of undefined

  10. 10

    Uncaught TypeError: Cannot read property 'linear' of undefined

  11. 11

    Uncaught TypeError: Cannot read property 'document' of undefined

  12. 12

    Uncaught TypeError: Cannot read property 'getZoom' of undefined

  13. 13

    Uncaught TypeError: Cannot read property 'match' of undefined

  14. 14

    Uncaught TypeError: Cannot read property 'arrayToDataTable' of undefined

  15. 15

    Uncaught TypeError: Cannot read property 'createRecord' of undefined

  16. 16

    Uncaught TypeError: Cannot read property 'login' of undefined

  17. 17

    Uncaught TypeError: Cannot read property 'children' of undefined

  18. 18

    Uncaught TypeError: Cannot read property 'LayoutMode' of undefined

  19. 19

    Uncaught TypeError: Cannot read property 'server' of undefined

  20. 20

    Uncaught TypeError: Cannot read property 'length' of undefined

  21. 21

    Uncaught TypeError: Cannot read property 'value' of undefined

  22. 22

    Uncaught TypeError: Cannot read property 'fn' of undefined

  23. 23

    Uncaught TypeError: Cannot read property 'message' of undefined

  24. 24

    Uncaught TypeError: Cannot read property 'scrollHeight' of undefined

  25. 25

    Uncaught TypeError: Cannot read property 'split' of undefined

  26. 26

    "Uncaught TypeError: Cannot read property 'people' of undefined "

  27. 27

    Uncaught TypeError: Cannot read property 'addClass' of undefined

  28. 28

    Uncaught TypeError: Cannot read property 'success' of undefined

  29. 29

    Uncaught TypeError: Cannot read property 'substr' of undefined

HotTag

Archive