ANK
ANK

Reputation: 293

Using Highcharts display donut hightchart having dynamic data

I am new to the highcharts. I am using donut highchart where in the below provided link we can get the static data

http://jsfiddle.net/gh/get/jquery/3.1.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/3d-pie-donut/

But i have a no. of data in the same format as

Highcharts.chart('container5',{
     chart: {
        type: 'pie',
        options3d: {
            enabled: true,
            alpha: 45
        }
    },
    title: {
        text: 'Daily Report'
    },
    subtitle: {
        text: '3D donut'
    },
    plotOptions: {
        pie: {
            innerSize: 100,
            depth: 45
        }
    },
    series: [{
        name: 'Amount',
        data: [$rootScope.oprep2]
    }]

})  

Here $rootScope.oprep2 is the data which in the array format as per the format shown / given in the demo as

enter image description here

in the above picture you can the line number 1025 which is in the required format.

enter image description here

the above pic shows the open array which contains data as unitno and amountpaid

My Query is, that the data is not displaying in the chart. So any idea, which will help me a lot. Here is the view as daily report

enter image description here

Here is my data

Array[11] =>
Array[2]=>
 0:"001"
 1:180
Array[2]=>
 0:"007"
 1:4570
Array[2]=>
 0:"008"
 1:1060
Array[2]=>
 0:"026"
 1:180

Each array is seperated by ,

Upvotes: 3

Views: 225

Answers (1)

Nitin Agarwal
Nitin Agarwal

Reputation: 941

As i have gone through your code, i see that your getting array of array, but you are assigning that data again with array which is not getting the chart. Instead of joining, separation, try to remove the array assign it directly.

data:$rootScope.oprep2

but not

data:[$rootScope.oprep2]

Upvotes: 1

Related Questions