使用Highcharts显示具有动态数据的圆环图

时间:2017-01-18 09:11:08

标签: angularjs highcharts

我是高等艺术的新手。我正在使用donut highchart,在下面提供的链接中我们可以获得静态数据

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

但我没有。与

格式相同的数据
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]
    }]

})  

这里$ rootScope.oprep2是数组格式的数据,按照演示中显示/给出的格式

enter image description here

在上图中,您可以使用所需格式的行号1025。

enter image description here

上面的图片显示了包含unitno和amountpaid

数据的open数组

我的查询是,数据未显示在图表中。所以任何想法,这将对我有很大帮助。以下是每日报告的视图

enter image description here

这是我的数据

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

每个数组都由

分隔

1 个答案:

答案 0 :(得分:1)

因为我已经完成了你的代码,我看到你得到的数组数组,但是你再次使用没有得到图表的数组来分配数据。而不是连接,分离,尝试删除数组直接分配它。

data:$rootScope.oprep2

但不是

data:[$rootScope.oprep2]
相关问题