0

i want to load the dynamic data and show cylinder chart. with static values chart working but variable data unble to assign to value field of fusion chart.

http://jsfiddle.net/qe5ruLqz/8/

<td >
            <fusioncharts id="chartContainer1" width="371" height="400" type="cylinder" datasource={{Bin1Data}}></fusioncharts>
        </td>
  <script>
            var app = angular.module('myApp', ["ng-fusioncharts"]);
        app.controller('myCtrl', function ($scope, $http) {
            $http.get('https://example.com', {
                headers: { 'Authorization': 'Basic abcd==' }
            })
            .then(function (response) {
                $scope.names = response.data;
                $scope.decodedFrame = atob($scope.names.dataFrame);
                $scope.decodedFrameNew = $scope.decodedFrame.substring(4);
                $scope.distanceinFeet = $scope.decodedFrameNew * 12.5 * 2.54;
                $scope.Value = $scope.distanceinFeet / 148;
                $scope.bin1Value = $scope.Value.toFixed(2);
                $scope.names.timestamp = new Date($scope.names.timestamp).toLocaleString(); // Parse the date to a localized string
                 $scope.Bin1Data.chart.value[0].value = $scope.bin1Value;// assigning value to chart
            });

            $scope.Bin1Data = {
                "chart": {
                    "caption": "Tank 2",
                    "lowerLimit": "0",
                    "upperLimit": "100",
                    "showValue": "1",
                    "valueBelowPivot": "1",
                    "theme": "fint",
                    "width": '50%',
                    "height": '50%',
                    "value":  [{
                        "value": 0 //unble to assign values here
                    }]

               }

            };
        });

1 Answer 1

1

You provide different code in question and fiddle. My answer is based on fiddle!

Your assignment is incorrect. You should pass data to $scope.Bin1Data.chart.value.

I edited Your fiddle to pass dynamic data. Look for refresh function and button. I think it is good point to go:

http://jsfiddle.net/yt1q2v5f/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.