作者:欢欢浮夸_704 | 来源:互联网 | 2023-05-18 12:20
UPDATE02-JUNE-2017:Wefixedtheproblembutnotfromtheanswershere.Iwilltrytoaddthesolut
UPDATE 02-JUNE-2017: We fixed the problem but not from the answers here. I will try to add the solution we have if I found it. We also switched to angular-nvd3
which uses d3
.
更新时间2017年6月2日:我们解决了问题,但没有解决这里的答案。如果我发现它,我会尝试添加我们的解决方案。我们还切换到使用d3的angular-nvd3。
EDIT 1: Added backgroundColor
in options, still doesnt work. Not sure if I put it in the correct place.
编辑1:在选项中添加了backgroundColor,仍然无法正常工作。不确定我是否把它放在正确的位置。
Using the sample here. How to make the color fill 100%?
在这里使用示例。如何使颜色填充100%?
JS:
$scope.labels = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
$scope.type = 'StackedBar';
$scope.series = ['2015', '2016'];
//$scope.colors = ['#AA1921', '#18AF5C'];
$scope.optiOns= {
scales: {
xAxes: [{
stacked: true,
}],
yAxes: [{
stacked: true
}]
},
title: {
display: true,
text: 'My First Bar Chart'
},
// added as suggested
backgroundColor: ['rgba(170, 25, 33, 1)', 'rgba(170, 25, 33, 1)']
};
$scope.data = [
[65, 59, 90, 81, 56, 55, 40],
[28, 48, 40, 19, 96, 27, 100]
];
HTML
I really want to use this kind of implementation but most problems I find are using a different implementation.
我真的想使用这种实现,但我发现的大多数问题都使用不同的实现。
3 个解决方案