我想在我的角度应用程序中添加一个图表。我决定使用 highchart-ng 指令。这是控制器:
discoutControllers.controller('TestController', function($scope/*, $location,$route,TableUtility, TestService*/) {
$scope.options = {
type: 'line'
}
$scope.swapChartType = function () {
if (this.highchartsNG.options.chart.type === 'line') {
this.highchartsNG.options.chart.type = 'column'
} else {
this.highchartsNG.options.chart.type = 'line'
}
}
$scope.highchartsNG = {
options: {
chart: {
type: 'column'
}
},
series: [{
data: [10, 15, 12, 8, 7]
}],
title: {
text: 'Hello'
},
loading: false
}
});
这是视图:
<div ng-controller='TestController' id="container" style="min-width: 310px; height: 400px; margin: 0 auto">
<highchart id="chart1" config="highchartsNG"></highchart>
</div>
问题是当我查看我的页面时没有呈现任何内容,我不知道发生了什么。
问候,