Skip to content

Instantly share code, notes, and snippets.

@nautilytics
Created January 2, 2020 15:49
Show Gist options
  • Save nautilytics/f0656f261749be4a42d4d75ae8493d83 to your computer and use it in GitHub Desktop.
Save nautilytics/f0656f261749be4a42d4d75ae8493d83 to your computer and use it in GitHub Desktop.
An example of creating an axis using Angular
<svg:g class="axis--x"></svg:g>
renderXAxis(): void {
const elem = this.element.nativeElement.querySelector('.axis--x');
const xAxis = select(elem);
this.zone.runOutsideAngular(() => {
xAxis
.call(axisBottom(this.item.xScale));
});
}
ngOnChanges() {
this.renderXAxis();
}
ngOnInit() {
this.renderXAxis();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment