With the same code, just with the data filtered differently such that the .group() has negative values and the .stack() group has positive values then it renders correctly:
Positive stacked on negative:
It's this that makes me think it is a bug rather than a problem with my code. But could someone please see if they can reproduce this? or perhaps give me some suggestions where I might be going wrong.
I'm using the current stable 1.3 and my chart code looks like:
netPositionMTEbyAccountChart
.width(300)
.height(200)
.dimension(accountNetPositionDollarMTE)
.group(accountNetPositionDollarMTEgroup)
.stack(accountNetOrderDollarMTEgroup)
.margins({ top: 10, left: 40, right: 10, bottom: 80 })
.elasticY(true)
.x(d3.scale.ordinal().domain(accountList))
.xUnits(dc.units.ordinal)
.renderlet(function (chart) {
chart.selectAll("g.x text")
.attr('dx', '-38')
.attr('dy', '0')
.attr('transform', "rotate(-90)");
})
.yAxis().tickFormat(d3.format(".3s"));
Thanks in advance ,
Paul
else if (value < 0)
_groupStack.setDataPoint(groupIndex, dataIndex, _groupStack.getDataPoint(groupIndex - 1, dataIndex) + _chart.dataPointHeight(d, groupIndex - 1))
else if (value < 0)
if (_groupStack.getDataPoint(groupIndex - 1, dataIndex) > _chart.dataPointBaseline())
_groupStack.setDataPoint(groupIndex, dataIndex, _groupStack.getDataPoint(groupIndex - 1, dataIndex) + _chart.dataPointHeight(d, groupIndex - 1));
else
_groupStack.setDataPoint(groupIndex, dataIndex, _chart.dataPointBaseline());