[英]Highcharts (highcharts-ng) with ng-repeat worked, But need to pass the data for each chart from the attributes
我喜歡從視圖模板傳遞日期,也可以從控制器傳遞日期,以便highchart應該映射<highchart />
指令給出的數據。
說明:
<ul>
<li ng-repeat="li in list">
<highchart id="chart1"
config="chart"
chartTitle="{{li.name}}"
kpiValue="{{li.data}}">
</highchart>
</li>
</ul>
在我的控制器中,我有如下代碼
myapp.controller('myctrl', function ($scope) {
$scope.list = [
{data:10,name:'first KPI',type:"bar"}, /*Make a bar chart of title 'first KPI', with a bar length to 10 */
{data:12,name:'sec KPI',type:"bar"}, /*Make a bar chart of title 'sec KPI',with a bar length to 12 */
{data:32,name:'third KPI',type:"bar"} /*Make a bar chart of title 'third KPI',with a bar length to 32 */
];
....
....
$scope.chart = {
options: {
chart: {
type: 'bar'
}
},
series: [{
data: [10] //to make accepts the values dynamically from <highcharts />, Need help
}],
title: {
text: 'Hello' //to make accepts the values dynamically from <highcharts />, Need help
},
loading: false
}
});
我要說的是,我想要3個條形圖
如果您看到了unk小子,您將對我在說什么有更多的了解。
將https://github.com/pablojim/highcharts-ng用於<highcharts />
嘗試https://github.com/pablojim/highcharts-ng
您需要創建包裝highchart元素的指令。 您遇到了角度圖和高圖的范圍問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.