Commit 5e9fd991 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix bar width when categorized axis

parent dd3f6715
...@@ -2117,8 +2117,7 @@ ...@@ -2117,8 +2117,7 @@
var rectX, rectW; var rectX, rectW;
var withY, withSubchart, withTransition, withTransform, withUpdateXDomain, withUpdateOrgXDomain; var withY, withSubchart, withTransition, withTransform, withUpdateXDomain, withUpdateOrgXDomain;
var hideAxis = hasArcType(c3.data.targets); var hideAxis = hasArcType(c3.data.targets);
var drawBar = generateDrawBar(barIndices), drawBarOnSub = generateDrawBar(barIndices, true); var drawBar, drawBarOnSub, xForText, yForText;
var xForText = generateXYForText(barIndices, true), yForText = generateXYForText(barIndices, false);
var duration; var duration;
options = isDefined(options) ? options : {}; options = isDefined(options) ? options : {};
...@@ -2152,6 +2151,11 @@ ...@@ -2152,6 +2151,11 @@
main.select(".y.axis").style("opacity", hideAxis ? 0 : 1).transition().duration(__axis_rotated ? 0 : duration).call(__axis_rotated ? xAxis : yAxis); main.select(".y.axis").style("opacity", hideAxis ? 0 : 1).transition().duration(__axis_rotated ? 0 : duration).call(__axis_rotated ? xAxis : yAxis);
main.select(".y2.axis").style("opacity", hideAxis ? 0 : 1).transition().call(yAxis2); main.select(".y2.axis").style("opacity", hideAxis ? 0 : 1).transition().call(yAxis2);
// setup drawer - MEMO: these must be called after axis updated
drawBar = generateDrawBar(barIndices);
xForText = generateXYForText(barIndices, true);
yForText = generateXYForText(barIndices, false);
// Update label position // Update label position
main.select(".x.axis .-axis-x-label").attr("x", width); main.select(".x.axis .-axis-x-label").attr("x", width);
...@@ -2335,6 +2339,8 @@ ...@@ -2335,6 +2339,8 @@
if (!brush.empty()) { if (!brush.empty()) {
brush.extent(x.orgDomain()).update(); brush.extent(x.orgDomain()).update();
} }
// setup drawer - MEMO: this must be called after axis updated
drawBarOnSub = generateDrawBar(barIndices, true);
// bars // bars
contextBar = context.selectAll('.-bars').selectAll('.-bar') contextBar = context.selectAll('.-bars').selectAll('.-bar')
.data(barData); .data(barData);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment