2016-08-23 52 views
0

我正在创建基于cumulocity的angularJS自定义应用程序。有没有可以在SDK中使用的指令来显示图形?我也从cumulocity支持问过这个问题,答案是他们的图表是用D3完成的,他们也给我这个链接http://krispo.github.io/angular-nvd3/#/如果他们没有提供开箱即用的指令,我该如何获取这个图表的数据?Cumulocity图形指令

例如,如果我选择网关和子设备如何获取所选机器的数据?

回答

0

Google图表功能数据查询。 Google图表和Angular都是由Google制作的。你可以将它与Angular结合起来。

https://developers.google.com/chart/

例如

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
    <title>Google Visualization API Sample</title> 
    <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> 
    <script type="text/javascript"> 
    google.charts.load("current", {packages:['table']}); 
    google.charts.setOnLoadCallback(drawVisualization); 
    function drawVisualization() { 
     google.visualization.drawChart({ 
     "containerId": "visualization_div", 
     "dataSourceUrl": "//www.google.com/fusiontables/gvizdata?tq=", 
     "query":"SELECT 'Scoring Team', 'Receiving Team', 'Scorer', 'Minute of goal' FROM " + 
       "1VlPiBCkYt_Vio-JT3UwM-U__APurJvPb6ZEJPg", 
     "refreshInterval": 5, 
     "chartType": "Table", 
     "options": {} 
    }); 
    } 
    </script> 
</head> 
<body style="font-family: Arial;border: 0 none;"> 
    <div id="visualization_div" style="width: 600px; height: 400px;"></div> 
</body> 
</html> 
+0

您是否使用过带有Cumulocity的谷歌图表?数据有奇怪的格式,所以我不知道这是否容易实现。 – Shnigi