Skip to content

Instantly share code, notes, and snippets.

@mpayetta
Created March 28, 2018 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpayetta/fac903207656b3ac54cf36f8667be66d to your computer and use it in GitHub Desktop.
Save mpayetta/fac903207656b3ac54cf36f8667be66d to your computer and use it in GitHub Desktop.
d3-canvas-7
// 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