Skip to content

Commit

Permalink
Merge pull request #158 from RhoInc/protect-y-labels
Browse files Browse the repository at this point in the history
protect Y-axis label
  • Loading branch information
samussiah authored Jul 19, 2019
2 parents 7498d7c + 7e5ea46 commit 5b54b21
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions queryOverview.js
Original file line number Diff line number Diff line change
Expand Up @@ -1725,13 +1725,22 @@
this.svg.selectAll('.y.axis .tick').remove();
}

function updateXAxisLabel$1() {
// Make sure that the Y axis Label is tucked safely beneath reset chart button
this.svg
.select('.y.axis')
.select('.axis-title')
.attr('transform', 'translate(5,0)rotate(-90)');
}

function onDraw() {
setLeftMargin.call(this);
setXDomain.call(this);
setYDomain.call(this);
setChartHeight.call(this);
updateXAxisLabel.call(this);
resetYAxisTickLabels.call(this);
updateXAxisLabel$1.call(this);
}

function legendFilter() {
Expand Down
2 changes: 2 additions & 0 deletions src/chart/onDraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import setYDomain from './onDraw/setYDomain';
import setChartHeight from './onDraw/setChartHeight';
import updateXAxisLabel from './onDraw/updateXAxisLabel';
import resetYAxisTickLabels from './onDraw/resetYAxisTickLabels';
import updateYAxisLabel from './onDraw/updateYAxisLabel';

export default function onDraw() {
setLeftMargin.call(this);
Expand All @@ -12,4 +13,5 @@ export default function onDraw() {
setChartHeight.call(this);
updateXAxisLabel.call(this);
resetYAxisTickLabels.call(this);
updateYAxisLabel.call(this);
}
7 changes: 7 additions & 0 deletions src/chart/onDraw/updateYAxisLabel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function updateXAxisLabel() {
// Make sure that the Y axis Label is tucked safely beneath reset chart button
this.svg
.select('.y.axis')
.select('.axis-title')
.attr('transform', 'translate(5,0)rotate(-90)');
}

0 comments on commit 5b54b21

Please sign in to comment.