Manually update chart

This commit is contained in:
2017-04-05 10:21:40 +02:00
parent 3adfef0cfe
commit 0b6b63df4f
11 changed files with 612 additions and 598 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+29 -21
View File
@@ -91,14 +91,14 @@ function toData(r) {
return num;
}
function timeToData(r) {
var times = r.time.substring(11, 18);
var times = r.time.substring(11, 19);
return times;
}
//# sourceMappingURL=C:/Users/avans/Documents/Angular/Smarthome-local/mean-app/src/data.service.js.map
/***/ }),
/***/ 385:
/***/ 386:
/***/ (function(module, exports) {
function webpackEmptyContext(req) {
@@ -107,20 +107,20 @@ function webpackEmptyContext(req) {
webpackEmptyContext.keys = function() { return []; };
webpackEmptyContext.resolve = webpackEmptyContext;
module.exports = webpackEmptyContext;
webpackEmptyContext.id = 385;
webpackEmptyContext.id = 386;
/***/ }),
/***/ 386:
/***/ 387:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dynamic__ = __webpack_require__(473);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dynamic__ = __webpack_require__(474);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__environments_environment__ = __webpack_require__(508);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__app_app_module__ = __webpack_require__(506);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__environments_environment__ = __webpack_require__(509);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__app_app_module__ = __webpack_require__(507);
@@ -133,12 +133,12 @@ __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_platform_browser_dyna
/***/ }),
/***/ 504:
/***/ 505:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_router__ = __webpack_require__(493);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_router__ = __webpack_require__(494);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__dashboard_component__ = __webpack_require__(329);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppRoutingModule; });
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
@@ -173,7 +173,7 @@ var AppRoutingModule = (function () {
/***/ }),
/***/ 505:
/***/ 506:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -207,19 +207,19 @@ var AppComponent = (function () {
/***/ }),
/***/ 506:
/***/ 507:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_platform_browser__ = __webpack_require__(148);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_forms__ = __webpack_require__(464);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__angular_forms__ = __webpack_require__(465);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__angular_http__ = __webpack_require__(306);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_ng2_charts_ng2_charts__ = __webpack_require__(663);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_ng2_charts_ng2_charts__ = __webpack_require__(368);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_ng2_charts_ng2_charts___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_ng2_charts_ng2_charts__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__app_routing_module__ = __webpack_require__(504);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__app_component__ = __webpack_require__(505);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__chart_component__ = __webpack_require__(507);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__app_routing_module__ = __webpack_require__(505);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__app_component__ = __webpack_require__(506);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__chart_component__ = __webpack_require__(508);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__dashboard_component__ = __webpack_require__(329);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__data_service__ = __webpack_require__(330);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AppModule; });
@@ -270,12 +270,14 @@ var AppModule = (function () {
/***/ }),
/***/ 507:
/***/ 508:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__(0);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__data_service__ = __webpack_require__(330);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ng2_charts_ng2_charts__ = __webpack_require__(368);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_ng2_charts_ng2_charts___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_ng2_charts_ng2_charts__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LineChartComponent; });
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
@@ -288,6 +290,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
};
var LineChartComponent = (function () {
function LineChartComponent(dataService) {
this.dataService = dataService;
@@ -335,24 +338,29 @@ var LineChartComponent = (function () {
_this.lineChartData = newDataSet;
console.log("Updated lines array");
console.log(_this.lineChartData);
_this.chart.chart.update();
});
console.log("Init");
};
__decorate([
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["ViewChild"])(__WEBPACK_IMPORTED_MODULE_2_ng2_charts_ng2_charts__["BaseChartDirective"]),
__metadata('design:type', (typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_2_ng2_charts_ng2_charts__["BaseChartDirective"] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_2_ng2_charts_ng2_charts__["BaseChartDirective"]) === 'function' && _a) || Object)
], LineChartComponent.prototype, "chart", void 0);
LineChartComponent = __decorate([
__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({
selector: 'line-chart',
template: __webpack_require__(667)
}),
__metadata('design:paramtypes', [(typeof (_a = typeof __WEBPACK_IMPORTED_MODULE_1__data_service__["a" /* DataService */] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_1__data_service__["a" /* DataService */]) === 'function' && _a) || Object])
__metadata('design:paramtypes', [(typeof (_b = typeof __WEBPACK_IMPORTED_MODULE_1__data_service__["a" /* DataService */] !== 'undefined' && __WEBPACK_IMPORTED_MODULE_1__data_service__["a" /* DataService */]) === 'function' && _b) || Object])
], LineChartComponent);
return LineChartComponent;
var _a;
var _a, _b;
}());
//# sourceMappingURL=C:/Users/avans/Documents/Angular/Smarthome-local/mean-app/src/chart.component.js.map
/***/ }),
/***/ 508:
/***/ 509:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@@ -399,7 +407,7 @@ module.exports = "<div>\r\n\t<line-chart></line-chart>\r\n</div>"
/***/ 687:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(386);
module.exports = __webpack_require__(387);
/***/ })
+1 -1
View File
File diff suppressed because one or more lines are too long
+270 -270
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
+6 -6
View File
@@ -1,12 +1,12 @@
webpackJsonp([2,4],{
/***/ 388:
/***/ 389:
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(659);
var content = __webpack_require__(660);
if(typeof content === 'string') content = [[module.i, content, '']];
// add the styles to the DOM
var update = __webpack_require__(685)(content, {});
@@ -27,10 +27,10 @@ if(false) {
/***/ }),
/***/ 659:
/***/ 660:
/***/ (function(module, exports, __webpack_require__) {
exports = module.exports = __webpack_require__(660)();
exports = module.exports = __webpack_require__(661)();
// imports
@@ -42,7 +42,7 @@ exports.push([module.i, "/* You can add global styles to this file, and also imp
/***/ }),
/***/ 660:
/***/ 661:
/***/ (function(module, exports) {
/*
@@ -355,7 +355,7 @@ function updateLink(linkElement, obj) {
/***/ 689:
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(388);
module.exports = __webpack_require__(389);
/***/ })
+1 -1
View File
File diff suppressed because one or more lines are too long
+294 -294
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
+7 -1
View File
@@ -1,13 +1,17 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
import { DataService } from './data.service';
import { LineData } from './line-data';
import { BaseChartDirective } from 'ng2-charts/ng2-charts';
@Component({
selector: 'line-chart',
templateUrl: './chart.component.html'
})
export class LineChartComponent implements OnInit {
@ViewChild(BaseChartDirective) public chart: BaseChartDirective;
// lineChart
public lineChartData:Array<any> = [
{data: [0,0,0,0,0,0,0], label: 'Totaal verbruik'}
@@ -59,6 +63,8 @@ export class LineChartComponent implements OnInit {
console.log("Updated lines array");
console.log(this.lineChartData);
this.chart.chart.update();
});
console.log("Init");
+1 -1
View File
@@ -47,7 +47,7 @@ function toData(r:any){
}
function timeToData(r:any){
let times = r.time.substring(11,18);
let times = r.time.substring(11,19);
return times;
}