{"action":"created","issue":{"url":"https://api.github.com/repos/nnnick/Chart.js/issues/2187","repository_url":"https://api.github.com/repos/nnnick/Chart.js","labels_url":"https://api.github.com/repos/nnnick/Chart.js/issues/2187/labels{/name}","comments_url":"https://api.github.com/repos/nnnick/Chart.js/issues/2187/comments","events_url":"https://api.github.com/repos/nnnick/Chart.js/issues/2187/events","html_url":"https://github.com/nnnick/Chart.js/issues/2187","id":144484466,"number":2187,"title":"[question] Is it possible to select the Chart object from another JS file ?","user":{"login":"chrisvel","id":2040900,"avatar_url":"https://avatars.githubusercontent.com/u/2040900?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisvel","html_url":"https://github.com/chrisvel","followers_url":"https://api.github.com/users/chrisvel/followers","following_url":"https://api.github.com/users/chrisvel/following{/other_user}","gists_url":"https://api.github.com/users/chrisvel/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisvel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisvel/subscriptions","organizations_url":"https://api.github.com/users/chrisvel/orgs","repos_url":"https://api.github.com/users/chrisvel/repos","events_url":"https://api.github.com/users/chrisvel/events{/privacy}","received_events_url":"https://api.github.com/users/chrisvel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nnnick/Chart.js/labels/Category:%20Question","name":"Category: Question","color":"cc317c"},{"url":"https://api.github.com/repos/nnnick/Chart.js/labels/Version:%202.x","name":"Version: 2.x","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-30T07:16:41Z","updated_at":"2016-03-30T14:01:00Z","closed_at":null,"body":"I have two JS files, one that I initiate the Chart Line object and draw it on the page and one that I am getting some data with websockets. I want to \"get\" the element on the page (canvas) who carries the chart, so I'll be able to .addData and .removeData to make it dynamic. \r\n\r\nI have tried `$(\"#myTempChart\").addData([14], \"test\");` but I get a `TypeError: $(...).addData is not a function` which seems obvious that will happen. How could I make this work ?  \r\n\r\nThe original statement is `var myTempChart = new Chart( temp_ctx, {\r\n       type: 'line',\r\n       data: temp_data,\r\n       options: temp_options\r\n     });`\r\n"},"comment":{"url":"https://api.github.com/repos/nnnick/Chart.js/issues/comments/203445934","html_url":"https://github.com/nnnick/Chart.js/issues/2187#issuecomment-203445934","issue_url":"https://api.github.com/repos/nnnick/Chart.js/issues/2187","id":203445934,"user":{"login":"etimberg","id":6757853,"avatar_url":"https://avatars.githubusercontent.com/u/6757853?v=3","gravatar_id":"","url":"https://api.github.com/users/etimberg","html_url":"https://github.com/etimberg","followers_url":"https://api.github.com/users/etimberg/followers","following_url":"https://api.github.com/users/etimberg/following{/other_user}","gists_url":"https://api.github.com/users/etimberg/gists{/gist_id}","starred_url":"https://api.github.com/users/etimberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etimberg/subscriptions","organizations_url":"https://api.github.com/users/etimberg/orgs","repos_url":"https://api.github.com/users/etimberg/repos","events_url":"https://api.github.com/users/etimberg/events{/privacy}","received_events_url":"https://api.github.com/users/etimberg/received_events","type":"User","site_admin":false},"created_at":"2016-03-30T14:01:00Z","updated_at":"2016-03-30T14:01:00Z","body":"@chrisvel at the moment you'll need to keep track of the chart objects yourself. We don't attach them to the canvas object in anyway. "}}