Skip to content

Instantly share code, notes, and snippets.

@keathmilligan
Created August 26, 2017 16:16
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 keathmilligan/62fdc8be7bb367b007960d1469d91c86 to your computer and use it in GitHub Desktop.
Save keathmilligan/62fdc8be7bb367b007960d1469d91c86 to your computer and use it in GitHub Desktop.
The #chart id will be used to get a reference to the native element.
The components size, colors and other attributes can be controlled with CSS. The default component styles are defined barchart.component.css:
.d3-chart {
width: 100%;
height: 400px;
}
.d3-chart .axis path,
.d3-chart .axis line {
stroke: #999;
}
.d3-chart .axis text {
fill: #999;
}
@BeritJanssen
Copy link

Thank you so much for the tutorial! Note that the two lines on top should be commented out. Otherwise the div element of the bar chart is set to height & width zero, and the bars won't show (tested in Chrome).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment