GrantMStevens / amCharts-Angular

Angular directive for amCharts library
Apache License 2.0
63 stars 39 forks source link

Unsupported configuration/tag? #50

Closed rkheir closed 8 years ago

rkheir commented 8 years ago

Hi,

I was looking at the list of exposed configuration options in AM Charts as the readme indicates however I found that dataLoader is not supported? I also checked the directives code but it doesn't seem like it is. I need to fetch some data from REST/json and I was trying to use the "data" since dataLoader is not there but that won't work:

I tried:

angular.module('MyMod')
.controller('LnoCtrl', ['$scope', '$http', LnoCtrl]);

function LnoCtrl($scope, $http ) {

var chartData;
$http({
          method: 'GET',
          url: 'http://XXX/API/apiLink'
        }).then(function successCallback(response) {
            chartData = response.data;
            alert (chartData[0].item); //this works
        $scope.amChartOptions = {
            data: chartData ,
            type: "serial",
etc. etc.

I am getting a TypeError: Cannot read property 'data' of undefined

Any plans on including dataLoader capability? Do you mind helping with a workaround or suggesting what is wrong if not?

rkheir commented 8 years ago

Ended up using dataloader plugin with standard instead of this directive.