mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-18 08:20:13 +01:00
pieChart service
This commit is contained in:
parent
d5d7247c5d
commit
73e8ef5721
2 changed files with 39 additions and 25 deletions
|
|
@ -1,44 +1,25 @@
|
||||||
import {Component, ViewEncapsulation} from 'angular2/core';
|
import {Component, ViewEncapsulation} from 'angular2/core';
|
||||||
|
|
||||||
import {BaCard} from '../../../theme/components';
|
import {BaCard} from '../../../theme/components';
|
||||||
|
import {PieChartService} from './pieChart.service';
|
||||||
|
|
||||||
import './pieChart.loader.ts';
|
import './pieChart.loader.ts';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'pie-chart',
|
selector: 'pie-chart',
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
directives: [BaCard],
|
directives: [BaCard],
|
||||||
|
providers: [PieChartService],
|
||||||
styles: [require('./pieChart.scss')],
|
styles: [require('./pieChart.scss')],
|
||||||
template: require('./pieChart.html')
|
template: require('./pieChart.html')
|
||||||
})
|
})
|
||||||
export class PieChart {
|
export class PieChart {
|
||||||
|
|
||||||
charts = [
|
public charts: Array<Object>;
|
||||||
{
|
|
||||||
color: 'rgba(255,255,255,0.4)',
|
|
||||||
description: 'New Visits',
|
|
||||||
stats: '57,820',
|
|
||||||
icon: 'person',
|
|
||||||
}, {
|
|
||||||
color: 'rgba(255,255,255,0.4)',
|
|
||||||
description: 'Purchases',
|
|
||||||
stats: '$ 89,745',
|
|
||||||
icon: 'money',
|
|
||||||
}, {
|
|
||||||
color: 'rgba(255,255,255,0.4)',
|
|
||||||
description: 'Active Users',
|
|
||||||
stats: '178,391',
|
|
||||||
icon: 'face',
|
|
||||||
}, {
|
|
||||||
color: 'rgba(255,255,255,0.4)',
|
|
||||||
description: 'Returned',
|
|
||||||
stats: '32,592',
|
|
||||||
icon: 'refresh',
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
private _init = false;
|
private _init = false;
|
||||||
|
|
||||||
constructor() {
|
constructor(private _pieChartService: PieChartService) {
|
||||||
|
this.charts = this._pieChartService.getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit() {
|
ngAfterViewInit() {
|
||||||
|
|
|
||||||
33
src/app/pages/dashboard/pieChart/pieChart.service.ts
Normal file
33
src/app/pages/dashboard/pieChart/pieChart.service.ts
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
import {Injectable} from 'angular2/core';
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
export class PieChartService {
|
||||||
|
|
||||||
|
private _data = [
|
||||||
|
{
|
||||||
|
color: 'rgba(255,255,255,0.4)',
|
||||||
|
description: 'New Visits',
|
||||||
|
stats: '57,820',
|
||||||
|
icon: 'person',
|
||||||
|
}, {
|
||||||
|
color: 'rgba(255,255,255,0.4)',
|
||||||
|
description: 'Purchases',
|
||||||
|
stats: '$ 89,745',
|
||||||
|
icon: 'money',
|
||||||
|
}, {
|
||||||
|
color: 'rgba(255,255,255,0.4)',
|
||||||
|
description: 'Active Users',
|
||||||
|
stats: '178,391',
|
||||||
|
icon: 'face',
|
||||||
|
}, {
|
||||||
|
color: 'rgba(255,255,255,0.4)',
|
||||||
|
description: 'Returned',
|
||||||
|
stats: '32,592',
|
||||||
|
icon: 'refresh',
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
getData() {
|
||||||
|
return this._data;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue