저는 angularjs를 사용하는 작은 webapp를 가지고 있는데 angularJS library에서 두 개의 차트를 고소하려고합니다. 나는 술집과 파이를 사용하고 있습니다. 그들은 잘 렌더링하고 있지만 디스플레이가 작아 지거나 더 커지면 어떤 이유로 크기를 조정하지 않습니다. Angularjs 차트의 크기가 조정되지 않습니다.
내 HTML 코드 :.chartWrapper{
margin: 0 auto;
text-align: center;
vertical-align: top;
width: 80% !important;
}
내 자바 스크립트 코드
angular.module('app')
.config(['ChartJsProvider', function (ChartJsProvider) {
// Configure all charts
ChartJsProvider.setOptions({
colours: ['#FF0000', '#0000FF'],
responsive: true
});
// Configure all pie charts
ChartJsProvider.setOptions('Pie', {
datasetFill: true,
chartLegend: true
});
// Configure all bar charts
ChartJsProvider.setOptions('Bar', {
datasetFill: true,
chartLegend: true
});
}])
.controller('mainCtrl', function($scope){
var main = this;
$scope.answered = answered;
$scope.quAnswered = false;
$scope.pieData = [30,50];
$scope.chartData = [[30,60],[50,20]];
$scope.chartLabels = [ 'Female', 'Male'];
$scope.series = ['Pepsi', 'Coca-Cola'];
Chart.defaults.global.responsive = true;
function answered(){
}
})
[plunker] (https://plnkr.co/edit) 링크를 추가 할 수 있습니까? –