From 124af4fbb560fa54a6088d460493c0db8f2cc9db Mon Sep 17 00:00:00 2001 From: Masayuki Tanaka Date: Mon, 13 May 2013 21:01:46 +0900 Subject: [PATCH] Fix yaxis transition --- c3.js | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/c3.js b/c3.js index 19ca2b3..d24e5c0 100644 --- a/c3.js +++ b/c3.js @@ -1010,15 +1010,14 @@ withY = (typeof withY === 'undefined') ? false : withY withSubchart = (typeof withSubchart === 'undefined') ? false : withSubchart - x.domain(brush.empty() ? x2.domain() : brush.extent()) - // TODO: for stacked bars y.domain(getYDomain(c3.data.targets)) y2.domain(y.domain()) - main.selectAll(".y.axis").call(yAxis) + main.selectAll(".y.axis").transition().call(yAxis) // ticks for x-axis // ATTENTION: call here to update tickOffset + x.domain(brush.empty() ? x2.domain() : brush.extent()) main.selectAll(".x.axis").call(xAxis) // grid @@ -1252,12 +1251,6 @@ }) c3.data.targets = c3.data.targets.concat(targets) // add remained - if (__axis_y_rescale) { - y.domain(getYDomain(c3.data.targets)) - y2.domain(y.domain()) - main.select('.y.axis').transition().call(yAxis) - } - // Set targets updateTargets(c3.data.targets) @@ -1416,12 +1409,6 @@ updateLegend(c3.data.targets) } - if (__axis_y_rescale){ - y.domain(getYDomain(c3.data.targets)) - y2.domain(y.domain()) - main.select('.y.axis').transition().call(yAxis) - } - if (c3.data.targets.length > 0) redraw(true, true, true) }