added linedata type
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+3
-2
@@ -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;
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user