我使用dc-js创建了一个堆积条形图,我正在尝试增加尺寸。但是,每次我在图表上调整高度属性时,大部分图表都会从视图中删除。我的目标是通过放大图表来更容易地查看图表的每个堆栈。有关如何执行此操作的任何信息,以及添加height属性时图表下半部分消失的原因非常感谢!
提前感谢您的帮助。
Chart before adjusting height.(指护理区X视力表)
Chart after adding/adjusting the height to 1000(指护理区X视力表)
调整身高前的“护理区域x视力表”的Javascript:
aocChart
.width(500)
.margins({
top: 5,
right: 20,
bottom: 75,
left: 40
})
.dimension(aoc_dim)
.group(sums.pop(), acuity_strings[0])
.x(d3.scale.ordinal())
.xUnits(dc.units.ordinal)
.elasticY(true);
var index = 1;
sums.forEach(function(sum) {
aocChart.stack(sum, acuity_strings[index])
index++;
});
aocChart
// .legend(dc.legend().x(500).y(0).itemHeight(12).gap(5).horizontal(1).legendWidth(90).itemWidth(95))
.render();
Javascript for“护理区域x调整高度后的视力表:
aocChart
.width(500)
.height(1000)
.margins({
top: 5,
right: 20,
bottom: 75,
left: 40
})
.dimension(aoc_dim)
.group(sums.pop(), acuity_strings[0])
.x(d3.scale.ordinal())
.xUnits(dc.units.ordinal)
.elasticY(true);
var index = 1;
sums.forEach(function(sum) {
aocChart.stack(sum, acuity_strings[index])
index++;
});
aocChart
// .legend(dc.legend().x(500).y(0).itemHeight(12).gap(5).horizontal(1).legendWidth(90).itemWidth(95))
.render();