mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-19 08:50:13 +01:00
saving with admin and public base
This commit is contained in:
parent
06776d15c4
commit
dd1b2763d8
425 changed files with 21493 additions and 11663 deletions
84
src/app/admin/charts/d3/d3-line.component.ts
Normal file
84
src/app/admin/charts/d3/d3-line.component.ts
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
import { Component, OnDestroy } from '@angular/core';
|
||||
import { NbThemeService } from '@nebular/theme';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-d3-line',
|
||||
template: `
|
||||
<ngx-charts-line-chart
|
||||
[scheme]="colorScheme"
|
||||
[results]="multi"
|
||||
[xAxis]="showXAxis"
|
||||
[yAxis]="showYAxis"
|
||||
[legend]="showLegend"
|
||||
[showXAxisLabel]="showXAxisLabel"
|
||||
[showYAxisLabel]="showYAxisLabel"
|
||||
[xAxisLabel]="xAxisLabel"
|
||||
[yAxisLabel]="yAxisLabel">
|
||||
</ngx-charts-line-chart>
|
||||
`,
|
||||
})
|
||||
export class D3LineComponent implements OnDestroy {
|
||||
multi = [
|
||||
{
|
||||
name: 'Germany',
|
||||
series: [
|
||||
{
|
||||
name: '2010',
|
||||
value: 7300,
|
||||
},
|
||||
{
|
||||
name: '2011',
|
||||
value: 8940,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'USA',
|
||||
series: [
|
||||
{
|
||||
name: '2010',
|
||||
value: 7870,
|
||||
},
|
||||
{
|
||||
name: '2011',
|
||||
value: 8270,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'France',
|
||||
series: [
|
||||
{
|
||||
name: '2010',
|
||||
value: 5002,
|
||||
},
|
||||
{
|
||||
name: '2011',
|
||||
value: 5800,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
showLegend = true;
|
||||
showXAxis = true;
|
||||
showYAxis = true;
|
||||
showXAxisLabel = true;
|
||||
xAxisLabel = 'Country';
|
||||
showYAxisLabel = true;
|
||||
yAxisLabel = 'Population';
|
||||
colorScheme: any;
|
||||
themeSubscription: any;
|
||||
|
||||
constructor(private theme: NbThemeService) {
|
||||
this.themeSubscription = this.theme.getJsTheme().subscribe(config => {
|
||||
const colors: any = config.variables;
|
||||
this.colorScheme = {
|
||||
domain: [colors.primaryLight, colors.infoLight, colors.successLight, colors.warningLight, colors.dangerLight],
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.themeSubscription.unsubscribe();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue