feat(data): update data module, add new mock data (#1960)

This commit is contained in:
Denis Strigo 2019-01-08 16:17:20 +03:00 committed by GitHub
parent 773c14e74a
commit 47d232b606
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 635 additions and 256 deletions

View file

@ -1,9 +1,7 @@
import { delay, takeWhile } from 'rxjs/operators';
import { AfterViewInit, Component, OnDestroy } from '@angular/core';
import { AfterViewInit, Component, Input, OnDestroy } from '@angular/core';
import { NbThemeService } from '@nebular/theme';
import { LayoutService } from '../../../@core/data/layout.service';
const points = [300, 520, 435, 530, 730, 620, 660, 860];
import { LayoutService } from '../../../@core/utils';
@Component({
selector: 'ngx-traffic-chart',
@ -20,6 +18,8 @@ export class TrafficChartComponent implements AfterViewInit, OnDestroy {
private alive = true;
@Input() points: number[];
type = 'month';
types = ['week', 'month', 'year'];
option: any = {};
@ -53,7 +53,7 @@ export class TrafficChartComponent implements AfterViewInit, OnDestroy {
xAxis: {
type: 'category',
boundaryGap: false,
data: points,
data: this.points,
},
yAxis: {
boundaryGap: [0, '5%'],
@ -114,7 +114,7 @@ export class TrafficChartComponent implements AfterViewInit, OnDestroy {
color: trafficTheme.shadowLineDarkBg,
},
},
data: points.map(p => p - 15),
data: this.points.map(p => p - 15),
},
{
type: 'line',
@ -153,7 +153,7 @@ export class TrafficChartComponent implements AfterViewInit, OnDestroy {
opacity: 1,
},
},
data: points,
data: this.points,
},
],
});