mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-21 01:40:13 +01:00
feat(charts): integrate js theme with d3
This commit is contained in:
parent
746d18680e
commit
672615b710
8 changed files with 100 additions and 24 deletions
|
|
@ -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],
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue