feat(charts): integrate js theme with d3

This commit is contained in:
Alexander Zhukov 2017-07-31 15:03:12 +03:00
parent 746d18680e
commit 672615b710
8 changed files with 100 additions and 24 deletions

View file

@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { NgaThemeService } from '@akveo/nga-theme';
@Component({
selector: 'ngx-d3-line',
@ -61,9 +62,6 @@ export class D3LineComponent {
];
view: any[] = [700, 400];
showLegend = true;
colorScheme = {
domain: ['#5AA454', '#A10A28', '#C7B42C', '#AAAAAA'],
};
showXAxis = true;
showYAxis = true;
showLabels = true;
@ -71,4 +69,13 @@ export class D3LineComponent {
xAxisLabel = 'Country';
showYAxisLabel = true;
yAxisLabel = 'Population';
colorScheme: any;
constructor(private theme: NgaThemeService) {
this.theme.getJsTheme().subscribe(config => {
this.colorScheme = {
domain: [config.d3LineColor1, config.d3LineColor2, config.d3LineColor3, config.d3LineColor4],
};
});
}
}