Skip to content

Commit 7879f0a

Browse files
committed
Fixes dc-js#1818
1 parent 699f8dc commit 7879f0a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/base/coordinate-grid-mixin.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ export class CoordinateGridMixin extends ColorMixin(MarginMixin) {
579579
.attr('x1', d => this._x(d))
580580
.attr('y1', this._xAxisY() - this.margins().top)
581581
.attr('x2', d => this._x(d))
582-
.attr('y2', 0)
582+
.attr('y2', this._useTopXAxis ? this.height() - this.margins().top - this.margins().bottom : 0)
583583
.attr('opacity', 0);
584584
transition(linesGEnter, this.transitionDuration(), this.transitionDelay())
585585
.attr('opacity', 0.5);
@@ -589,7 +589,7 @@ export class CoordinateGridMixin extends ColorMixin(MarginMixin) {
589589
.attr('x1', d => this._x(d))
590590
.attr('y1', this._xAxisY() - this.margins().top)
591591
.attr('x2', d => this._x(d))
592-
.attr('y2', 0);
592+
.attr('y2', this._useTopXAxis ? this.height() - this.margins().top - this.margins().bottom : 0);
593593

594594
// exit
595595
lines.exit().remove();

web-src/examples/scatter-top.html

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
.margins({top: 30, right: 0, bottom: 10, left: 30})
3535
.x(d3.scaleLinear().domain([6,20]))
3636
.useTopXAxis(true)
37+
.renderVerticalGridLines(true)
3738
.xAxisLabel("This is the X Axis!")
3839
.brushOn(false)
3940
.symbolSize(8)

0 commit comments

Comments
 (0)