{"action":"created","issue":{"url":"https://api.github.com/repos/ThumbsAlmighty/amCharts-Angular/issues/5","labels_url":"https://api.github.com/repos/ThumbsAlmighty/amCharts-Angular/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/ThumbsAlmighty/amCharts-Angular/issues/5/comments","events_url":"https://api.github.com/repos/ThumbsAlmighty/amCharts-Angular/issues/5/events","html_url":"https://github.com/ThumbsAlmighty/amCharts-Angular/issues/5","id":80694418,"number":5,"title":"Load chart data with $http","user":{"login":"erikramalho","id":5274068,"avatar_url":"https://avatars.githubusercontent.com/u/5274068?v=3","gravatar_id":"","url":"https://api.github.com/users/erikramalho","html_url":"https://github.com/erikramalho","followers_url":"https://api.github.com/users/erikramalho/followers","following_url":"https://api.github.com/users/erikramalho/following{/other_user}","gists_url":"https://api.github.com/users/erikramalho/gists{/gist_id}","starred_url":"https://api.github.com/users/erikramalho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikramalho/subscriptions","organizations_url":"https://api.github.com/users/erikramalho/orgs","repos_url":"https://api.github.com/users/erikramalho/repos","events_url":"https://api.github.com/users/erikramalho/events{/privacy}","received_events_url":"https://api.github.com/users/erikramalho/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-25T22:46:06Z","updated_at":"2015-05-26T13:32:41Z","closed_at":null,"body":"Could you please document how to load $scope.options.data ($scope.amChartOptions) from $http?\r\nI'm requesting the data with a $http.get and assigning the result to it but the chart doesn't get updated.\r\n\r\n$http({url:'example', method: 'GET'}).success(function (response) {$scope.amChartOptions.data = response;});\r\n\r\nI've seen in the directive that you have some events... Could you give me a hand?"},"comment":{"url":"https://api.github.com/repos/ThumbsAlmighty/amCharts-Angular/issues/comments/105525085","html_url":"https://github.com/ThumbsAlmighty/amCharts-Angular/issues/5#issuecomment-105525085","issue_url":"https://api.github.com/repos/ThumbsAlmighty/amCharts-Angular/issues/5","id":105525085,"user":{"login":"ThumbsAlmighty","id":5571479,"avatar_url":"https://avatars.githubusercontent.com/u/5571479?v=3","gravatar_id":"","url":"https://api.github.com/users/ThumbsAlmighty","html_url":"https://github.com/ThumbsAlmighty","followers_url":"https://api.github.com/users/ThumbsAlmighty/followers","following_url":"https://api.github.com/users/ThumbsAlmighty/following{/other_user}","gists_url":"https://api.github.com/users/ThumbsAlmighty/gists{/gist_id}","starred_url":"https://api.github.com/users/ThumbsAlmighty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThumbsAlmighty/subscriptions","organizations_url":"https://api.github.com/users/ThumbsAlmighty/orgs","repos_url":"https://api.github.com/users/ThumbsAlmighty/repos","events_url":"https://api.github.com/users/ThumbsAlmighty/events{/privacy}","received_events_url":"https://api.github.com/users/ThumbsAlmighty/received_events","type":"User","site_admin":false},"created_at":"2015-05-26T13:32:41Z","updated_at":"2015-05-26T13:32:41Z","body":"Are you rendering the chart before the http call is completed?\r\n\r\nThere arent any watchers in place to see if the data object changes, so it would be up to you to handle that. Your best best to do this would be to use the amCharts.updateData event. Something like this:\r\n\r\n```javascript\r\n$http({url:'example', method: 'GET'}).success(function (response) {\r\n    $scope.$broadcast('amCharts.updateData', response, 'MyChartId');\r\n});\r\n```\r\n\r\nMake you are passing the id of the chart as the third argument. This will trigger the chart to reload itself with the new dataset.\r\n\r\nI am going to try to find some time to build this directive out some more, which will include a watcher to detect changes in the data object and reload the chart accordingly. For now, your best bet is to use the event."}}