|
|
@ -91,14 +91,15 @@ c3_chart_internal_fn.generateGetBarPoints = function (barIndices, isSub) { |
|
|
|
axis = isSub ? $$.subXAxis : $$.xAxis, |
|
|
|
axis = isSub ? $$.subXAxis : $$.xAxis, |
|
|
|
barTargetsNum = barIndices.__max__ + 1, |
|
|
|
barTargetsNum = barIndices.__max__ + 1, |
|
|
|
barW = $$.getBarW(axis, barTargetsNum), |
|
|
|
barW = $$.getBarW(axis, barTargetsNum), |
|
|
|
barX = $$.getShapeX(barW, barTargetsNum, barIndices, !!isSub), |
|
|
|
barSpaceWidth = barW * $$.config.bar_space, |
|
|
|
|
|
|
|
barX = $$.getShapeX(barW + barSpaceWidth, barTargetsNum, barIndices, !!isSub), |
|
|
|
barY = $$.getShapeY(!!isSub), |
|
|
|
barY = $$.getShapeY(!!isSub), |
|
|
|
barOffset = $$.getShapeOffset($$.isBarType, barIndices, !!isSub), |
|
|
|
barOffset = $$.getShapeOffset($$.isBarType, barIndices, !!isSub), |
|
|
|
yScale = isSub ? $$.getSubYScale : $$.getYScale; |
|
|
|
yScale = isSub ? $$.getSubYScale : $$.getYScale; |
|
|
|
return function (d, i) { |
|
|
|
return function (d, i) { |
|
|
|
var y0 = yScale.call($$, d.id)(0), |
|
|
|
var y0 = yScale.call($$, d.id)(0), |
|
|
|
offset = barOffset(d, i) || y0, // offset is for stacked bar chart
|
|
|
|
offset = barOffset(d, i) || y0, // offset is for stacked bar chart
|
|
|
|
posX = barX(d), posY = barY(d); |
|
|
|
posX = barX(d) + barSpaceWidth / 2, posY = barY(d); |
|
|
|
// fix posY not to overflow opposite quadrant
|
|
|
|
// fix posY not to overflow opposite quadrant
|
|
|
|
if ($$.config.axis_rotated) { |
|
|
|
if ($$.config.axis_rotated) { |
|
|
|
if ((0 < d.value && posY < y0) || (d.value < 0 && y0 < posY)) { posY = y0; } |
|
|
|
if ((0 < d.value && posY < y0) || (d.value < 0 && y0 < posY)) { posY = y0; } |
|
|
|