Created
March 28, 2018 22:29
-
-
Save mpayetta/fac903207656b3ac54cf36f8667be66d to your computer and use it in GitHub Desktop.
d3-canvas-7
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
// Add Axis | |
const gxAxis = svgChart.append('g') | |
.attr('transform', `translate(0, ${height})`) | |
.call(xAxis); | |
const gyAxis = svgChart.append('g') | |
.call(yAxis); | |
// Add labels | |
svgChart.append('text') | |
.attr('x', `-${height/2}`) | |
.attr('dy', '-3.5em') | |
.attr('transform', 'rotate(-90)') | |
.text('Axis Y'); | |
svgChart.append('text') | |
.attr('x', `${width/2}`) | |
.attr('y', `${height + 40}`) | |
.text('Axis X'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment