Commit c4001a6e authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix y tick format when resize - #41

parent 4e6885a0
...@@ -330,10 +330,10 @@ ...@@ -330,10 +330,10 @@
subY = getY(subYMin, subYMax); subY = getY(subYMin, subYMax);
subY2 = getY(subYMin, subYMax); subY2 = getY(subYMin, subYMax);
// update axes // update axes
xAxis = getXAxis(x, xOrient); xAxis = getXAxis(x, xOrient, getXAxisTickFormat());
yAxis = getYAxis(y, yOrient); yAxis = getYAxis(y, yOrient, __axis_y_tick_format);
yAxis2 = getYAxis(y2, y2Orient); yAxis2 = getYAxis(y2, y2Orient, __axis_y2_tick_format);
subXAxis = getXAxis(subX, subXOrient); subXAxis = getXAxis(subX, subXOrient, getXAxisTickFormat());
// update for arc // update for arc
updateArc(); updateArc();
} }
...@@ -381,11 +381,11 @@ ...@@ -381,11 +381,11 @@
//-- Axes --// //-- Axes --//
function getXAxis(scale, orient) { function getXAxis(scale, orient, tickFormat) {
var axis = (isCategorized ? categoryAxis() : d3.svg.axis()).scale(scale).orient(orient); var axis = (isCategorized ? categoryAxis() : d3.svg.axis()).scale(scale).orient(orient);
// Set tick format // Set tick format
axis.tickFormat(getXAxisTickFormat()); axis.tickFormat(tickFormat);
// Set categories // Set categories
if (isCategorized) { if (isCategorized) {
...@@ -397,8 +397,8 @@ ...@@ -397,8 +397,8 @@
return axis; return axis;
} }
function getYAxis(scale, orient) { function getYAxis(scale, orient, tickFormat) {
return d3.svg.axis().scale(scale).orient(orient); return d3.svg.axis().scale(scale).orient(orient).tickFormat(tickFormat);
} }
function getAxisId(id) { function getAxisId(id) {
return id in __data_axes ? __data_axes[id] : 'y'; return id in __data_axes ? __data_axes[id] : 'y';
...@@ -1491,8 +1491,8 @@ ...@@ -1491,8 +1491,8 @@
// Set axes attrs // Set axes attrs
xAxis.ticks(data.length < 10 ? data.length : 10); xAxis.ticks(data.length < 10 ? data.length : 10);
yAxis.ticks(__axis_y_ticks).outerTickSize(0).tickFormat(__axis_y_tick_format); yAxis.ticks(__axis_y_ticks).outerTickSize(0);
yAxis2.ticks(__axis_y2_ticks).outerTickSize(0).tickFormat(__axis_y2_tick_format); yAxis2.ticks(__axis_y2_ticks).outerTickSize(0);
// Save original x domain for zoom update // Save original x domain for zoom update
orgXDomain = x.domain(); orgXDomain = x.domain();
......
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