0

I have used line chart. Here is the link of line chart http://jsfiddle.net/highcharts/qyntd1xa/ I have stuck in pass dynamically data in line chart. How to pass dynamically data in line chart. i am new in angular js here is my controller function code-

$scope.updatedays   =   function(){ 
        $scope.data =   $scope.getdata();
        console.log($scope.data);

        Highcharts.chart('cont2', {
            xAxis: {
                categories: ['MON 12', 'TUE 13', 'WED 14', 'THU 15', 'FRI 16', 'SAT 17', 'SUN 18']
            },

            series: [{
                data: [1.5, 5.5, 3.0, 2.5, 4.5, 3, 2]
            }]
        });
    }

I tryed pass dynamically data but i getting error in Highcharts.

2
  • 1
    What errors are you getting? And what does "dynamic data" look like? Be specific when you post a question Commented Jul 6, 2016 at 13:41
  • How about using the highchart-ng ? Commented Jul 7, 2016 at 13:30

1 Answer 1

1

Store your data and your categories in two separate arrays that match up by index and then use those two arrays as your values.

For example:

xAxis: {
    categories: myCategoriesArray
},

series: [{
    data: myDataArray
}]

If you want to pass the arrays into your function, check out this post.

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.