{"action":"created","issue":{"url":"https://api.github.com/repos/fundon/nchart/issues/7","labels_url":"https://api.github.com/repos/fundon/nchart/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/fundon/nchart/issues/7/comments","events_url":"https://api.github.com/repos/fundon/nchart/issues/7/events","html_url":"https://github.com/fundon/nchart/issues/7","id":59693418,"number":7,"title":"Cannot set property 'canvas' of undefined","user":{"login":"metbosch","id":4162025,"avatar_url":"https://avatars.githubusercontent.com/u/4162025?v=3","gravatar_id":"","url":"https://api.github.com/users/metbosch","html_url":"https://github.com/metbosch","followers_url":"https://api.github.com/users/metbosch/followers","following_url":"https://api.github.com/users/metbosch/following{/other_user}","gists_url":"https://api.github.com/users/metbosch/gists{/gist_id}","starred_url":"https://api.github.com/users/metbosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/metbosch/subscriptions","organizations_url":"https://api.github.com/users/metbosch/orgs","repos_url":"https://api.github.com/users/metbosch/repos","events_url":"https://api.github.com/users/metbosch/events{/privacy}","received_events_url":"https://api.github.com/users/metbosch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-03T19:37:30Z","updated_at":"2015-03-12T12:36:23Z","closed_at":null,"body":"When I try to run the example code on my installation I get the following error:\r\n >TypeError: Cannot set property 'canvas' of undefined\r\n >at Chart (/usr/local/lib/node_modules/nchart/Chart.js:22:15)\r\n >at repl:1:7\r\n    at REPLServer.self.eval (repl.js:110:21)\r\n    at repl.js:249:20\r\n    at REPLServer.self.eval (repl.js:122:7)\r\n    at Interface.<anonymous> (repl.js:239:12)\r\n    at Interface.emit (events.js:95:17)\r\n    at Interface._onLine (readline.js:202:10)\r\n    at Interface._line (readline.js:531:8)\r\n    at Interface._ttyWrite (readline.js:760:14)\r\n\r\nThe code was executed in the interactive console and the error appears on the call 'Chart(ctx)'."},"comment":{"url":"https://api.github.com/repos/fundon/nchart/issues/comments/78471546","html_url":"https://github.com/fundon/nchart/issues/7#issuecomment-78471546","issue_url":"https://api.github.com/repos/fundon/nchart/issues/7","id":78471546,"user":{"login":"jurgen7777","id":1902888,"avatar_url":"https://avatars.githubusercontent.com/u/1902888?v=3","gravatar_id":"","url":"https://api.github.com/users/jurgen7777","html_url":"https://github.com/jurgen7777","followers_url":"https://api.github.com/users/jurgen7777/followers","following_url":"https://api.github.com/users/jurgen7777/following{/other_user}","gists_url":"https://api.github.com/users/jurgen7777/gists{/gist_id}","starred_url":"https://api.github.com/users/jurgen7777/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jurgen7777/subscriptions","organizations_url":"https://api.github.com/users/jurgen7777/orgs","repos_url":"https://api.github.com/users/jurgen7777/repos","events_url":"https://api.github.com/users/jurgen7777/events{/privacy}","received_events_url":"https://api.github.com/users/jurgen7777/received_events","type":"User","site_admin":false},"created_at":"2015-03-12T12:36:23Z","updated_at":"2015-03-12T12:36:23Z","body":"Looks like to get it working instead of\r\n```javascript\r\nvar Chart = require('nchart');\r\n```\r\nshould be\r\n```javascript\r\nvar Chart = new (require('nchart'))(ctx);\r\n```\r\nand the following part\r\n```javascript\r\nChart(ctx).Pie(\r\n```\r\n\r\nshould be\r\n```javascript\r\nChart.Pie(\r\n```\r\n"}}