mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-23 10:50:13 +01:00
feat(charts): add chart.js examples page
This commit is contained in:
parent
626da294c4
commit
cf23f972d1
22 changed files with 657 additions and 264 deletions
73
src/app/pages/charts/d3/line/line.component.ts
Normal file
73
src/app/pages/charts/d3/line/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