mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-23 10:50: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
55
src/app/pages/charts/d3/d3-bar.component.ts
Normal file
55
src/app/pages/charts/d3/d3-bar.component.ts
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-d3-bar',
|
||||
template: `
|
||||
<ngx-charts-bar-vertical
|
||||
[view]="view"
|
||||
[scheme]="colorScheme"
|
||||
[results]="single"
|
||||
[xAxis]="showXAxis"
|
||||
[yAxis]="showYAxis"
|
||||
[legend]="showLegend"
|
||||
[showXAxisLabel]="showXAxisLabel"
|
||||
[showYAxisLabel]="showYAxisLabel"
|
||||
[xAxisLabel]="xAxisLabel"
|
||||
[yAxisLabel]="yAxisLabel">
|
||||
</ngx-charts-bar-vertical>
|
||||
`,
|
||||
})
|
||||
export class D3BarComponent {
|
||||
|
||||
single = [{
|
||||
name: 'Germany',
|
||||
value: 8940000,
|
||||
}, {
|
||||
name: 'USA',
|
||||
value: 5000000,
|
||||
}, {
|
||||
name: 'France',
|
||||
value: 7200000,
|
||||
}];
|
||||
|
||||
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