mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-20 01:10:13 +01:00
style(charts): refactoring components hierarchy
This commit is contained in:
parent
2d16bad88f
commit
cf9ccf1850
25 changed files with 179 additions and 44 deletions
73
src/app/pages/charts/d3/d3-line.component.ts
Normal file
73
src/app/pages/charts/d3/d3-line.component.ts
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-d3-line',
|
||||
template: `
|
||||
<ngx-charts-line-chart
|
||||
[view]="view"
|
||||
[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 {
|
||||
|
||||
multi = [{
|
||||
name: 'Germany',
|
||||
series: [{
|
||||
name: '2010',
|
||||
value: 7300000,
|
||||
}, {
|
||||
name: '2011',
|
||||
value: 8940000,
|
||||
}],
|
||||
}, {
|
||||
name: 'USA',
|
||||
series: [{
|
||||
name: '2010',
|
||||
value: 7870000,
|
||||
}, {
|
||||
name: '2011',
|
||||
value: 8270000,
|
||||
}],
|
||||
}, {
|
||||
name: 'France',
|
||||
series: [{
|
||||
name: '2010',
|
||||
value: 5000002,
|
||||
}, {
|
||||
name: '2011',
|
||||
value: 5800000,
|
||||
}],
|
||||
}];
|
||||
|
||||
view: any[] = [700, 400];
|
||||
|
||||
showLegend = true;
|
||||
|
||||
colorScheme = {
|
||||
domain: ['#5AA454', '#A10A28', '#C7B42C', '#AAAAAA'],
|
||||
};
|
||||
|
||||
showXAxis = true;
|
||||
|
||||
showYAxis = true;
|
||||
|
||||
showLabels = true;
|
||||
|
||||
showXAxisLabel = true;
|
||||
|
||||
xAxisLabel = 'Country';
|
||||
|
||||
showYAxisLabel = true;
|
||||
|
||||
yAxisLabel = 'Population';
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue