Commit 05492968 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix y grid lines

parent 6ab3a456
...@@ -1873,7 +1873,7 @@ ...@@ -1873,7 +1873,7 @@
} }
function redraw(options) { function redraw(options) {
var xgrid, xgridData, xgridLine, ygrid; var xgrid, xgridData, xgridLines, ygrid, ygridLines;
var mainCircle, mainBar, mainRegion, contextBar, eventRectUpdate; var mainCircle, mainBar, mainRegion, contextBar, eventRectUpdate;
var barIndices = getBarIndices(), barTargetsNum = barIndices.__max__ + 1, maxDataCountTarget; var barIndices = getBarIndices(), barTargetsNum = barIndices.__max__ + 1, maxDataCountTarget;
var rectX, rectW; var rectX, rectW;
...@@ -1950,13 +1950,14 @@ ...@@ -1950,13 +1950,14 @@
xgrid.exit().remove(); xgrid.exit().remove();
} }
if (__grid_x_lines) { if (__grid_x_lines) {
xgridLine = main.selectAll(".xgrid-lines"); xgridLines = main.selectAll(".xgrid-lines");
xgridLine.selectAll('line') xgridLines.selectAll('line')
.transition().duration(duration)
.attr("x1", __axis_rotated ? 0 : xv) .attr("x1", __axis_rotated ? 0 : xv)
.attr("x2", __axis_rotated ? width : xv) .attr("x2", __axis_rotated ? width : xv)
.attr("y1", __axis_rotated ? xv : margin.top) .attr("y1", __axis_rotated ? xv : margin.top)
.attr("y2", __axis_rotated ? xv : height); .attr("y2", __axis_rotated ? xv : height);
xgridLine.selectAll('text') xgridLines.selectAll('text')
.attr("x", __axis_rotated ? width : 0) .attr("x", __axis_rotated ? width : 0)
.attr("y", xv); .attr("y", xv);
} }
...@@ -1973,9 +1974,13 @@ ...@@ -1973,9 +1974,13 @@
ygrid.exit().remove(); ygrid.exit().remove();
} }
if (withY && __grid_y_lines) { if (withY && __grid_y_lines) {
main.select('.ygrid-lines').selectAll('.ygrid-line') ygridLines = main.select('.ygrid-lines');
.attr("y1", yv) ygridLines.selectAll('line')
.attr("y2", yv); .transition().duration(duration)
.attr("x1", __axis_rotated ? yv : 0)
.attr("x2", __axis_rotated ? yv : width)
.attr("y1", __axis_rotated ? 0 : yv)
.attr("y2", __axis_rotated ? height : yv);
} }
// bars // bars
......
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