This commit is contained in:
Bluepr1nt
2017-04-04 14:55:10 +02:00
parent 95686653ef
commit c3f1ed2d2e
5 changed files with 12 additions and 6 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+4 -2
View File
@@ -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"])({
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -1
View File
@@ -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");
}
}
+3 -1
View File
@@ -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;
}