Sign in to follow this  

Fusion Chart and Angular JS $HTTP request

Recommended Posts

Hi Team,

              I am not able to generate the angular chart if the scope variables are present inside the HTTP request. Thanks in advance . If the scope is available outside http it works perfect. Thanks . Any help on this is appreciated


<html ng-app="HelloApp">
<body ng-controller="MyController">
<div >
var app = angular.module('HelloApp', ["ng-fusioncharts"]);
app.controller('MyController', function ($scope,$http) {
var req='Any Rest URL';
   method: 'GET',
   url: req
  }).then(function successCallback(response) {
  //var data=[];
  $scope.myDataSource = {
        chart: {
            caption: "Harry's SuperMart",
            subCaption: "Top 5 stores in last month by revenue",
            numberPrefix: "$"
        data: [{
            label: "Bakersfield Central",
            value: "880000"
        }, {
            label: "Garden Groove harbour",
            value: "730000"
        }, {
            label: "Los Angeles Topanga",
            value: "590000"
        }, {
            label: "Compton-Rancho Dom",
            value: "520000"
        }, {
            label: "Daly City Serramonte",
            value: "330000"
   }, function errorCallback(response) {
  // $scope.Results=gems;
  //$ gems;
Edited by imurpal

Share this post

Link to post
Share on other sites



Can you check if there is any error in browser console for the issue?


Also, please share a scaled down sample for issue you are facing so that I can assist you accordingly.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this