added linedata type

This commit is contained in:
Bluepr1nt
2017-04-04 14:47:20 +02:00
parent aefd347a3f
commit acdc958afb
5 changed files with 13 additions and 11 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -2
View File
@@ -54,6 +54,7 @@ function mapData(response) {
var nums = response.json().map(toData);
console.log(nums);
var line = ({ data: nums, label: "Line 1" });
console.log(line);
return line;
}
function toData(r) {
@@ -235,10 +236,10 @@ var LineChartComponent = (function () {
}
// events
LineChartComponent.prototype.chartClicked = function (e) {
console.log(e);
//console.log(e);
};
LineChartComponent.prototype.chartHovered = function (e) {
console.log(e);
//console.log(e);
};
LineChartComponent.prototype.ngOnInit = function () {
var _this = this;
+1 -1
View File
File diff suppressed because one or more lines are too long
+6 -6
View File
@@ -1,6 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { DataService } from './data.service';
import { LineData } from './line-data';
@Component({
@@ -28,14 +28,14 @@ export class LineChartComponent implements OnInit {
];
public lineChartLegend:boolean = true;
public lineChartType:string = 'line';
// events
public chartClicked(e:any):void {
console.log(e);
//console.log(e);
}
public chartHovered(e:any):void {
console.log(e);
//console.log(e);
}
constructor(private dataService: DataService) {}
@@ -46,4 +46,4 @@ export class LineChartComponent implements OnInit {
.get()
.subscribe(res => this.lineChartData[0].data = res.data);
}
}
}
+2 -1
View File
@@ -37,7 +37,8 @@ function mapData(response:Response): LineData {
console.log(nums);
let line = <LineData>({data: nums, label: "Line 1"});
let line:LineData = <LineData>({data: nums, label: "Line 1"});
console.log(line);
return line;
}