Try to update graphs as well
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+3
-1
@@ -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"])(),
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user