Commit 74f65b3d authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix tickInterval when transition

parent 6cf97b72
...@@ -6621,7 +6621,6 @@ ...@@ -6621,7 +6621,6 @@
var scale = d3.scale.linear(), orient = "bottom", innerTickSize = 6, outerTickSize, tickPadding = 3, tickValues = null, tickFormat, tickArguments; var scale = d3.scale.linear(), orient = "bottom", innerTickSize = 6, outerTickSize, tickPadding = 3, tickValues = null, tickFormat, tickArguments;
var tickOffset = 0, tickCulling = true, tickCentered; var tickOffset = 0, tickCulling = true, tickCentered;
var axis_g;
params = params || {}; params = params || {};
outerTickSize = params.withOuterTick ? 6 : 0; outerTickSize = params.withOuterTick ? 6 : 0;
...@@ -6688,9 +6687,9 @@ ...@@ -6688,9 +6687,9 @@
return size; return size;
} }
function axis(g) { function axis(g) {
axis_g = g;
g.each(function () { g.each(function () {
var g = d3.select(this); var g = axis.g = d3.select(this);
var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = copyScale(); var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = copyScale();
var ticks = tickValues ? tickValues : generateTicks(scale1), var ticks = tickValues ? tickValues : generateTicks(scale1),
...@@ -6882,8 +6881,8 @@ ...@@ -6882,8 +6881,8 @@
interval = tickOffset * 2; interval = tickOffset * 2;
} }
else { else {
length = axis_g.select('path.domain').node().getTotalLength() - outerTickSize * 2; length = axis.g.select('path.domain').node().getTotalLength() - outerTickSize * 2;
interval = length / axis_g.selectAll('line').size(); interval = length / axis.g.selectAll('line').size();
} }
return interval; return interval;
}; };
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -7,7 +7,6 @@ function c3_axis(d3, params) { ...@@ -7,7 +7,6 @@ function c3_axis(d3, params) {
var scale = d3.scale.linear(), orient = "bottom", innerTickSize = 6, outerTickSize, tickPadding = 3, tickValues = null, tickFormat, tickArguments; var scale = d3.scale.linear(), orient = "bottom", innerTickSize = 6, outerTickSize, tickPadding = 3, tickValues = null, tickFormat, tickArguments;
var tickOffset = 0, tickCulling = true, tickCentered; var tickOffset = 0, tickCulling = true, tickCentered;
var axis_g;
params = params || {}; params = params || {};
outerTickSize = params.withOuterTick ? 6 : 0; outerTickSize = params.withOuterTick ? 6 : 0;
...@@ -74,9 +73,9 @@ function c3_axis(d3, params) { ...@@ -74,9 +73,9 @@ function c3_axis(d3, params) {
return size; return size;
} }
function axis(g) { function axis(g) {
axis_g = g;
g.each(function () { g.each(function () {
var g = d3.select(this); var g = axis.g = d3.select(this);
var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = copyScale(); var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = copyScale();
var ticks = tickValues ? tickValues : generateTicks(scale1), var ticks = tickValues ? tickValues : generateTicks(scale1),
...@@ -268,8 +267,8 @@ function c3_axis(d3, params) { ...@@ -268,8 +267,8 @@ function c3_axis(d3, params) {
interval = tickOffset * 2; interval = tickOffset * 2;
} }
else { else {
length = axis_g.select('path.domain').node().getTotalLength() - outerTickSize * 2; length = axis.g.select('path.domain').node().getTotalLength() - outerTickSize * 2;
interval = length / axis_g.selectAll('line').size(); interval = length / axis.g.selectAll('line').size();
} }
return interval; return interval;
}; };
......
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