我正在使用angular-chart.js
它,但它在我的页面中不可见,我已将图表放入指令中。
我使用的代码:
<div class="row">
<div class="cold-md-12">
<canvas class="chart chart-line"
chart-data="data"
chart-labels="labels"
chart-series="series"
chart-options="options"
chart-dataset-override="datasetOverride"
chart-click="onClick"
style="display:block;width:500px;height:400px;">
</canvas>
</div>
</div>
控制器:
app.controller('detailsController',['$scope',function($scope){
$scope.labels = ["January", "February", "March", "April", "May", "June", "July"];
$scope.series = ['Series A', 'Series B'];
$scope.data = [
[65, 59, 80, 81, 56, 55, 40],
[28, 48, 40, 19, 86, 27, 90]
];
$scope.datasetOverride = [{ yAxisID: 'y-axis-1' }, { yAxisID: 'y-axis-2' }];
$scope.options = {
scales: {
yAxes: [
{
id: 'y-axis-1',
type: 'linear',
display: true,
position: 'left'
},
{
id: 'y-axis-2',
type: 'linear',
display: true,
position: 'right'
}
]
}
};
}]);
控制器放置正确,开发人员工具没有显示任何错误,我也得到元素唯一的问题是地图的可见性。