Try to update graphs as well

This commit is contained in:
2017-04-10 13:57:02 +02:00
parent 36fb2bb7e1
commit f710be45ae
5 changed files with 14 additions and 8 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -1
View File
@@ -557,7 +557,9 @@ var LineChartComponent = (function () {
var newLine = { data: this.data.data, label: this.data.label };
newDataSet.push(newLine);
this.lineChartData = newDataSet;
//this.chart.chart.update();
};
LineChartComponent.prototype.ngOnChanges = function () {
this.chart.chart.update();
};
__decorate([
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Input"])(),
+1 -1
View File
File diff suppressed because one or more lines are too long
+8 -4
View File
@@ -1,4 +1,4 @@
import { Component, OnInit, ViewChild, ElementRef,Input } from '@angular/core';
import { Component, OnInit, OnChanges, ViewChild, ElementRef,Input } from '@angular/core';
import { DataService } from './data.service';
import { LineData } from './line-data';
@@ -9,7 +9,7 @@ import {LabelData} from "./label-data";
selector: 'line-chart',
templateUrl: './chart.component.html'
})
export class LineChartComponent implements OnInit {
export class LineChartComponent implements OnInit, OnChanges {
@Input()data:LineData;
@Input()label:LabelData;
@@ -52,7 +52,11 @@ export class LineChartComponent implements OnInit {
const newLine = {data: this.data.data, label: this.data.label};
newDataSet.push(newLine);
this.lineChartData = newDataSet;
//this.chart.chart.update();
}
ngOnChanges(): void {
this.chart.chart.update();
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ import {LabelData} from "./label-data";
templateUrl: './detail.component.html'
})
export class DetailComponent implements OnInit {
export class DetailComponent implements OnInit, OnDestroy {
public id:string = 'Loading';
public name:string = "Loading";