Commit b678c157 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix category axis when init

parent a4bb085b
......@@ -3053,6 +3053,21 @@
transitions = transitions || generateAxisTransitions(durationForAxis);
// MEMO: call axis to generate ticks and get those length, then update translate with them
if (withUpdateTranslate) {
if (__axis_rotated) {
axes.x.call(xAxis);
axes.subx.call(subXAxis);
} else {
axes.y.call(yAxis);
axes.y2.call(y2Axis);
}
updateSizes();
updateScales();
updateSvgSize();
transformAll(false);
}
// update legend and transform each g
if (withLegend && __legend_show) {
updateLegend(mapToIds(c3.data.targets), options, transitions);
......@@ -3100,19 +3115,6 @@
// Update axis label
updateAxisLabels(withTransition);
// MEMO: need to be called after axis updated because updated tick's width will be used
if (withUpdateTranslate) {
updateSizes();
updateScales();
updateSvgSize();
transformAll(false);
// update axis again
axes.x.call(xAxis);
axes.y.call(yAxis);
axes.y2.call(y2Axis);
axes.subx.call(subXAxis);
}
// show/hide if manual culling needed
if (withUpdateXDomain && targetsToShow.length) {
if (__axis_x_tick_culling && tickValues) {
......@@ -4609,7 +4611,7 @@
textUpdate = tickUpdate.select("text");
if (isCategory) {
tickOffset = Math.ceil((scale1(1) - scale1(0)) / 2);
tickOffset = Math.round((scale1(1) - scale1(0)) / 2);
tickX = tickCentered ? 0 : tickOffset;
} else {
tickOffset = tickX = 0;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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