Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用angularjs和使用$http的json在Flot图表上绘制数据_Php_Mysql_Json_Angularjs_Flot - Fatal编程技术网

Php 使用angularjs和使用$http的json在Flot图表上绘制数据

Php 使用angularjs和使用$http的json在Flot图表上绘制数据,php,mysql,json,angularjs,flot,Php,Mysql,Json,Angularjs,Flot,我使用angularjs、php和mysql创建了一个应用程序。我设置了一个RESTful API,将mysql数据导出到json。我想知道如何使用下面的JSON数据在flot折线图上单独绘制Copra_Mc数据 [ { "productionhourlyNumber": "94", "Copra_Mc": "5.88741898", "Copra_Oil": "0.64851388" }, { "productionhourlyNum

我使用angularjs、php和mysql创建了一个应用程序。我设置了一个RESTful API,将mysql数据导出到json。我想知道如何使用下面的JSON数据在flot折线图上单独绘制Copra_Mc数据

  [
    {
    "productionhourlyNumber": "94",
    "Copra_Mc": "5.88741898",
    "Copra_Oil": "0.64851388"
    },
    {
    "productionhourlyNumber": "93",
    "Copra_Mc": "6.88741898",
    "Copra_Oil": ""
    },
    {
    "productionhourlyNumber": "92",
    "Copra_Mc": "5.89998",
    "Copra_Oil": ""
    }
]
HTML

图表是这样的

您需要通过$http使用流程图指令来使用json

在此处下载angularjs中flot图表的指令

https://www.npmjs.com/package/angular-flot
https://github.com/ErikAugust/angularjs-flot-chart-directive
并使用类似的方法

http://www.codeandyou.com/2015/02/injecting-service-to-directives-in.html

我在angularjs中使用flot chart指令,我很难将Copra_Mc单独从上述json中分离出来,以便在图形上绘图
https://www.npmjs.com/package/angular-flot
https://github.com/ErikAugust/angularjs-flot-chart-directive
http://www.codeandyou.com/2015/02/injecting-service-to-directives-in.html