test
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+4
-2
@@ -35,6 +35,7 @@ var DataService = (function () {
|
||||
this.http
|
||||
.get(("" + this.baseUrl), { headers: this.getHeaders() })
|
||||
.map(mapData);
|
||||
console.log(lineChartData$);
|
||||
return lineChartData$;
|
||||
};
|
||||
DataService.prototype.getHeaders = function () {
|
||||
@@ -53,7 +54,7 @@ function mapData(response) {
|
||||
console.log('Mapping data', __WEBPACK_IMPORTED_MODULE_3__line_data__["a" /* LineData */]);
|
||||
var nums = response.json().map(toData);
|
||||
console.log(nums);
|
||||
var line = ({ data: [90, 67, 77, 56, 45, 89, 90], label: "Series A" });
|
||||
var line = ({ data: nums, label: "Series A" });
|
||||
console.log(line);
|
||||
return line;
|
||||
}
|
||||
@@ -215,7 +216,7 @@ var LineChartComponent = (function () {
|
||||
this.dataService = dataService;
|
||||
// lineChart
|
||||
this.lineChartData = [
|
||||
{ data: [0, 0, 0, 0, 0, 0, 0], label: 'Series A' }
|
||||
{ data: [1, 0, 0, 0, 0, 0, 1], label: 'Series A' }
|
||||
];
|
||||
this.lineChartLabels = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];
|
||||
this.lineChartOptions = {
|
||||
@@ -246,6 +247,7 @@ var LineChartComponent = (function () {
|
||||
this.dataService
|
||||
.get()
|
||||
.subscribe(function (res) { return _this.lineChartData[0].data = res.data; });
|
||||
console.log("Init");
|
||||
};
|
||||
LineChartComponent = __decorate([
|
||||
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -10,7 +10,7 @@ import { LineData } from './line-data';
|
||||
export class LineChartComponent implements OnInit {
|
||||
// lineChart
|
||||
public lineChartData:Array<any> = [
|
||||
{data: [0,0,0,0,0,0,0], label: 'Series A'}
|
||||
{data: [1,0,0,0,0,0,1], label: 'Series A'}
|
||||
];
|
||||
public lineChartLabels:Array<any> = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];
|
||||
public lineChartOptions:any = {
|
||||
@@ -45,5 +45,7 @@ export class LineChartComponent implements OnInit {
|
||||
this.dataService
|
||||
.get()
|
||||
.subscribe(res => this.lineChartData[0].data = res.data);
|
||||
|
||||
console.log("Init");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ export class DataService {
|
||||
, {headers: this.getHeaders()})
|
||||
.map(mapData);
|
||||
|
||||
console.log(lineChartData$);
|
||||
|
||||
return lineChartData$;
|
||||
|
||||
}
|
||||
@@ -37,7 +39,7 @@ function mapData(response:Response): LineData {
|
||||
|
||||
console.log(nums);
|
||||
|
||||
let line:LineData = <LineData>({data: [90,67,77,56,45,89,90], label: "Series A"});
|
||||
let line:LineData = <LineData>({data: nums, label: "Series A"});
|
||||
console.log(line);
|
||||
return line;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user