Last active
February 4, 2018 13:54
-
-
Save levvsha/5ecff36ff6d31be08e1b60c93b5550e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const xAxis = d3.axisBottom(x) | |
.ticks((width + 2) / (height + 2) * 5) | |
.tickSize(-height - 6) | |
.tickPadding(10); | |
const yAxis = d3.axisRight(y) | |
.ticks(5) | |
.tickSize(7 + width) | |
.tickPadding(-15 - width) | |
.tickFormat(d => d + '%'); | |
svg.append('g') | |
.attr('class', 'axis x-axis') | |
.attr('transform', `translate(0,${ height + 6 })`) | |
.call(xAxis); | |
svg.append('g') | |
.attr('transform', 'translate(-7, 0)') | |
.attr('class', 'axis y-axis') | |
.call(yAxis); | |
svg.append('g') | |
.attr('transform', `translate(0,${ height })`) | |
.call(d3.axisBottom(x).ticks(0)); | |
svg.append('g') | |
.call(d3.axisLeft(y).ticks(0)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment