Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waiting on an http request #52

Open
jetheurer opened this issue Mar 8, 2016 · 1 comment
Open

Waiting on an http request #52

jetheurer opened this issue Mar 8, 2016 · 1 comment

Comments

@jetheurer
Copy link

I need to wait for an API call to return before generating the chart; however its not clear how to do this.

Thanks!

Liz

@sallespro
Copy link

sallespro commented Oct 17, 2016

i am in the same Endeavour, but it seems there are some issues to deal with.
i used the PieChart as a starting point. https://tomneyland.github.io/angular-dc/example/stocks/pie.html
and included the d3.request call instead of d3.json which doesn't allow to POST a query data.
BUT i get this error:

angular.js:9563 TypeError: _listeners.preRender is not a function
    at Object._chart.render (base-mixin.js:639)
    at Object.fn (angular-dc.min.js:8)
    at h.$digest (angular.js:12031)
    at h.$apply (angular.js:12279)
    at angular.js:13786
    at e (angular.js:4236)
    at angular.js:4537
    d3.request('url-to-query')
        .header('Content-Type', 'application/json' )
        .post(JSON.stringify(payload), 
        function( experiments ) { 

    ndx = crossfilter(experiments)
    $scope.runDimension = ndx.dimension(function(d) { return d.age; }),
    $scope.speedSumGroup = $scope.runDimension.group().all();

            }); 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants