From 7088ac29fc8d29a041237b3b1420eb6ef342e2b8 Mon Sep 17 00:00:00 2001 From: kennyboy55 Date: Wed, 5 Apr 2017 09:56:46 +0200 Subject: [PATCH] Try to update chart labels --- mean-app/dist/inline.bundle.map | 2 +- mean-app/dist/main.bundle.js | 4 +++- mean-app/dist/main.bundle.map | 2 +- mean-app/src/app/chart.component.ts | 4 +++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mean-app/dist/inline.bundle.map b/mean-app/dist/inline.bundle.map index a2e69a2..4a69b90 100644 --- a/mean-app/dist/inline.bundle.map +++ b/mean-app/dist/inline.bundle.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap 4f8b675fff2e657a2a17"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAI;AACJ;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA,kDAA0C,oBAAoB,WAAW","file":"inline.bundle.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId])\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length)\n \t\t\tresolves.shift()();\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t4: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tif(installedChunks[chunkId] === 0)\n \t\t\treturn Promise.resolve();\n\n \t\t// an Promise means \"currently loading\".\n \t\tif(installedChunks[chunkId]) {\n \t\t\treturn installedChunks[chunkId][2];\n \t\t}\n \t\t// start chunk loading\n \t\tvar head = document.getElementsByTagName('head')[0];\n \t\tvar script = document.createElement('script');\n \t\tscript.type = 'text/javascript';\n \t\tscript.charset = 'utf-8';\n \t\tscript.async = true;\n \t\tscript.timeout = 120000;\n\n \t\tif (__webpack_require__.nc) {\n \t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t}\n \t\tscript.src = __webpack_require__.p + \"\" + chunkId + \".chunk.js\";\n \t\tvar timeout = setTimeout(onScriptComplete, 120000);\n \t\tscript.onerror = script.onload = onScriptComplete;\n \t\tfunction onScriptComplete() {\n \t\t\t// avoid mem leaks in IE.\n \t\t\tscript.onerror = script.onload = null;\n \t\t\tclearTimeout(timeout);\n \t\t\tvar chunk = installedChunks[chunkId];\n \t\t\tif(chunk !== 0) {\n \t\t\t\tif(chunk) chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));\n \t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t}\n \t\t};\n\n \t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\tinstalledChunks[chunkId] = [resolve, reject];\n \t\t});\n \t\tinstalledChunks[chunkId][2] = promise;\n\n \t\thead.appendChild(script);\n \t\treturn promise;\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 4f8b675fff2e657a2a17"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap 14b14e33a4eff4776912"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAI;AACJ;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,mDAA2C,cAAc;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA,kDAA0C,oBAAoB,WAAW","file":"inline.bundle.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId])\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length)\n \t\t\tresolves.shift()();\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t4: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tif(installedChunks[chunkId] === 0)\n \t\t\treturn Promise.resolve();\n\n \t\t// an Promise means \"currently loading\".\n \t\tif(installedChunks[chunkId]) {\n \t\t\treturn installedChunks[chunkId][2];\n \t\t}\n \t\t// start chunk loading\n \t\tvar head = document.getElementsByTagName('head')[0];\n \t\tvar script = document.createElement('script');\n \t\tscript.type = 'text/javascript';\n \t\tscript.charset = 'utf-8';\n \t\tscript.async = true;\n \t\tscript.timeout = 120000;\n\n \t\tif (__webpack_require__.nc) {\n \t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t}\n \t\tscript.src = __webpack_require__.p + \"\" + chunkId + \".chunk.js\";\n \t\tvar timeout = setTimeout(onScriptComplete, 120000);\n \t\tscript.onerror = script.onload = onScriptComplete;\n \t\tfunction onScriptComplete() {\n \t\t\t// avoid mem leaks in IE.\n \t\t\tscript.onerror = script.onload = null;\n \t\t\tclearTimeout(timeout);\n \t\t\tvar chunk = installedChunks[chunkId];\n \t\t\tif(chunk !== 0) {\n \t\t\t\tif(chunk) chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));\n \t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t}\n \t\t};\n\n \t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\tinstalledChunks[chunkId] = [resolve, reject];\n \t\t});\n \t\tinstalledChunks[chunkId][2] = promise;\n\n \t\thead.appendChild(script);\n \t\treturn promise;\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// identity function for calling harmony imports with the correct context\n \t__webpack_require__.i = function(value) { return value; };\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 14b14e33a4eff4776912"],"sourceRoot":""} \ No newline at end of file diff --git a/mean-app/dist/main.bundle.js b/mean-app/dist/main.bundle.js index 4ebf425..5019ca5 100644 --- a/mean-app/dist/main.bundle.js +++ b/mean-app/dist/main.bundle.js @@ -343,7 +343,9 @@ var LineChartComponent = (function () { var newLine = { data: res.lines.data, label: res.lines.label }; newDataSet.push(newLine); _this.lineChartData = newDataSet; - _this.lineChartLabels = res.labels.data.slice(); + var newDataSet2 = []; + newDataSet2.push(res.labels.data.slice()); + _this.lineChartLabels = newDataSet2; }); console.log("Init"); }; diff --git a/mean-app/dist/main.bundle.map b/mean-app/dist/main.bundle.map index 4734ddc..ddb9b3c 100644 --- a/mean-app/dist/main.bundle.map +++ b/mean-app/dist/main.bundle.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./src/app/dashboard.component.ts","webpack:///./src/app/data.service.ts","webpack:///./src async","webpack:///./src/main.ts","webpack:///./src/app/app-routing.module.ts","webpack:///./src/app/app.component.ts","webpack:///./src/app/app.module.ts","webpack:///./src/app/chart.component.ts","webpack:///./src/app/graph-data.ts","webpack:///./src/environments/environment.ts","webpack:///./src/app/app.component.css","webpack:///./src/app/app.component.html","webpack:///./src/app/chart.component.html","webpack:///./src/app/dashboard.component.html"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAyC;AAOzC;IAAA;IAEA,CAAC;IAPD;QAAC,+EAAS,CAAC;YACT,QAAQ,EAAE,WAAW;YACrB,kCAAyC;SAC1C,CAAC;;0BAAA;IAIF,yBAAC;AAAD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;ACTyC;AAEZ;AACyB;AAGf;AAIxC;IAGE,qBAAoB,IAAW;QAAX,SAAI,GAAJ,IAAI,CAAO;QAFvB,YAAO,GAAW,cAAc,CAAC;IAER,CAAC;IAElC,yBAAG,GAAH;QACE,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC5B,IAAI,cAAc;QAChB,wEAAwE;QACxE,IAAI,CAAC,IAAI;aACN,GAAG,CAAC,CAAC,KAAG,IAAI,CAAC,OAAS,CAAC,EACpB,EAAC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAC,CAAC;aAChC,GAAG,CAAC,OAAO,CAAC,CAAC;QAElB,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC5B,MAAM,CAAC,cAAc,CAAC;IACxB,CAAC;IAEO,gCAAU,GAAlB;QACE,IAAI,OAAO,GAAG,IAAI,8DAAO,EAAE,CAAC;QAC5B,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;QAC7C,MAAM,CAAC,OAAO,CAAC;IACjB,CAAC;IAvBH;QAAC,gFAAU,EAAE;;mBAAA;IAwBb,kBAAC;;AAAD,CAAC;AAED,iBAAiB,QAAiB;IAChC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,8DAAS,CAAC,CAAC;IACvC,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACvC,IAAI,KAAK,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,G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AAC,+EAAS,CAAC;YACT,QAAQ,EAAE,YAAY;YACtB,kCAAqC;SACtC,CAAC;;0BAAA;IAwDF,yBAAC;;AAAD,CAAC;;;;;;;;;;AC7DD;IAAA;IAGA,CAAC;IAAD,gBAAC;AAAD,CAAC;;;;;;;;;ACND;AAAA,mFAAmF;AACnF,8FAA8F;AAC9F,yEAAyE;AACzE,+EAA+E;AAExE,IAAM,WAAW,GAAG;IACzB,UAAU,EAAE,KAAK;CAClB,CAAC;;;;;;;;ACPF,sBAAsB,kBAAkB,KAAK,C;;;;;;;ACA7C,klCAAklC,OAAO,kI;;;;;;;ACAzlC,uGAAuG,6f;;;;;;;ACAvG,iE","file":"main.bundle.js","sourcesContent":["import { Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'dashboard',\r\n templateUrl: './dashboard.component.html'\r\n})\r\n\r\nexport class DashboardComponent {\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/dashboard.component.ts","import { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs/Rx';\r\nimport 'rxjs/add/operator/map'\r\nimport { Http, Response, Headers } from '@angular/http';\r\n\r\nimport { LineData } from './line-data';\r\nimport { GraphData } from './graph-data';\r\nimport { LabelData } from './label-data';\r\n\r\n@Injectable()\r\nexport class DataService {\r\n private baseUrl: string = '/webapi/data';\r\n\r\n constructor(private http : Http){}\r\n\r\n get(): Observable {\r\n console.log('Getting data');\r\n let lineChartData$ =\r\n //( {data: [65, 59, 80, 81, 56, 55, 40], label: 'Series A'} );\r\n this.http\r\n .get((`${this.baseUrl}`)\r\n , {headers: this.getHeaders()})\r\n .map(mapData);\r\n\r\n console.log(lineChartData$);\r\n return lineChartData$;\r\n }\r\n\r\n private getHeaders(){\r\n let headers = new Headers();\r\n headers.append('Accept', 'application/json');\r\n return headers;\r\n }\r\n}\r\n\r\nfunction mapData(response:Response): GraphData {\r\n console.log('Mapping data', GraphData);\r\n let nums = response.json().map(toData);\r\n let times = response.json().map(timeToData)\r\n\r\n console.log(nums);\r\n\r\n let line:LineData = ({data: nums, label: \"Series A\"});\r\n let label:LabelData = ({data: times});\r\n console.log(line);\r\n let graph:GraphData = ({lines:line,labels:label});\r\n return graph;\r\n}\r\n\r\nfunction toData(r:any){\r\n let num = r.TOE1;\r\n console.log('Parsed Data:', num);\r\n return num;\r\n}\r\n\r\nfunction timeToData(r:any){\r\n let times = r.time.substring(11,18);\r\n console.log('Parsed Time:', times);\r\n return times;\r\n}\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/data.service.ts","function webpackEmptyContext(req) {\n\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = 385;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src async\n// module id = 385\n// module chunks = 1","import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\r\nimport { enableProdMode } from '@angular/core';\r\nimport { environment } from './environments/environment';\r\nimport { AppModule } from './app/app.module';\r\n\r\nif (environment.production) {\r\n enableProdMode();\r\n}\r\n\r\nplatformBrowserDynamic().bootstrapModule(AppModule);\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/main.ts","import { NgModule } from '@angular/core';\r\nimport { RouterModule, Routes } from '@angular/router';\r\nimport { DashboardComponent } from './dashboard.component';\r\n\r\nconst routes: Routes = [\r\n { path: '', redirectTo: '/dashboard', pathMatch: 'full' },\r\n { path: 'dashboard', component: DashboardComponent },\r\n];\r\n@NgModule({\r\n imports: [ RouterModule.forRoot(routes) ],\r\n exports: [ RouterModule ]\r\n})\r\nexport class AppRoutingModule {}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/app-routing.module.ts","import { Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-root',\r\n templateUrl: './app.component.html',\r\n styleUrls: ['./app.component.css']\r\n})\r\nexport class AppComponent {\r\n title = 'Energie';\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/app.component.ts","import { BrowserModule } from '@angular/platform-browser';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { HttpModule } from '@angular/http';\r\nimport { ChartsModule } from 'ng2-charts/ng2-charts';\r\n\r\nimport { AppRoutingModule } from './app-routing.module';\r\n\r\nimport { AppComponent } from './app.component';\r\nimport { LineChartComponent } from './chart.component';\r\nimport { DashboardComponent } from './dashboard.component';\r\n\r\nimport { DataService } from './data.service';\r\n\r\n@NgModule({\r\n declarations: [\r\n AppComponent,\r\n LineChartComponent,\r\n DashboardComponent\r\n ],\r\n imports: [\r\n BrowserModule,\r\n FormsModule,\r\n HttpModule,\r\n ChartsModule,\r\n AppRoutingModule\r\n ],\r\n providers: [DataService],\r\n bootstrap: [AppComponent]\r\n})\r\nexport class AppModule { }\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/app.module.ts","import { Component, OnInit } from '@angular/core';\r\nimport { DataService } from './data.service';\r\n\r\nimport { LineData } from './line-data';\r\n\r\n@Component({\r\n selector: 'line-chart',\r\n templateUrl: './chart.component.html'\r\n})\r\nexport class LineChartComponent implements OnInit {\r\n // lineChart\r\n public lineChartData:Array = [\r\n {data: [1,0,0,0,0,0,1], label: 'Series A'}\r\n ];\r\n public lineChartLabels:Array = ['', '', '', '', '', '', ''];\r\n public lineChartOptions:any = {\r\n responsive: true,\r\n title: {\r\n display: true,\r\n position: 'left',\r\n text: 'Watt'\r\n }\r\n };\r\n public lineChartColors:Array = [\r\n { // grey\r\n backgroundColor: 'rgba(148,159,177,0.2)',\r\n borderColor: 'rgba(148,159,177,1)',\r\n pointBackgroundColor: 'rgba(148,159,177,1)',\r\n pointBorderColor: '#fff',\r\n pointHoverBackgroundColor: '#fff',\r\n pointHoverBorderColor: 'rgba(148,159,177,0.8)'\r\n }\r\n ];\r\n public lineChartLegend:boolean = true;\r\n public lineChartType:string = 'line';\r\n\r\n // events\r\n public chartClicked(e:any):void {\r\n //console.log(e);\r\n }\r\n\r\n public chartHovered(e:any):void {\r\n //console.log(e);\r\n }\r\n\r\n constructor(private dataService: DataService) {}\r\n\r\n ngOnInit(): void {\r\n\r\n this.dataService\r\n .get()\r\n .subscribe(res => {\r\n console.log(res);\r\n\r\n const newDataSet = [];\r\n const newLine = {data: res.lines.data, label: res.lines.label};\r\n newDataSet.push(newLine);\r\n this.lineChartData = newDataSet;\r\n\r\n this.lineChartLabels = res.labels.data.slice();\r\n });\r\n\r\n console.log(\"Init\");\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/chart.component.ts","import { LineData } from './line-data';\r\nimport { LabelData } from './label-data';\r\n\r\nexport class GraphData {\r\n public lines: LineData;\r\n public labels: LabelData;\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/graph-data.ts","// The file contents for the current environment will overwrite these during build.\r\n// The build system defaults to the dev environment which uses `environment.ts`, but if you do\r\n// `ng build --env=prod` then `environment.prod.ts` will be used instead.\r\n// The list of which env maps to which file can be found in `angular-cli.json`.\r\n\r\nexport const environment = {\r\n production: false\r\n};\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/environments/environment.ts","module.exports = \"h1 {\\r\\n\\tcolor: blue;\\r\\n}\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/app.component.css\n// module id = 666\n// module chunks = 1","module.exports = \"
\\r\\n\\r\\n \\r\\n\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n

{{title}} Avans

\\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n\\r\\n
\\r\\n
\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/app.component.html\n// module id = 667\n// module chunks = 1","module.exports = \"
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/chart.component.html\n// module id = 668\n// module chunks = 1","module.exports = \"
\\r\\n\\t\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/dashboard.component.html\n// module id = 669\n// module chunks = 1"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///./src/app/dashboard.component.ts","webpack:///./src/app/data.service.ts","webpack:///./src async","webpack:///./src/main.ts","webpack:///./src/app/app-routing.module.ts","webpack:///./src/app/app.component.ts","webpack:///./src/app/app.module.ts","webpack:///./src/app/chart.component.ts","webpack:///./src/app/graph-data.ts","webpack:///./src/environments/environment.ts","webpack:///./src/app/app.component.css","webpack:///./src/app/app.component.html","webpack:///./src/app/chart.component.html","webpack:///./src/app/dashboard.component.html"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAyC;AAOzC;IAAA;IAEA,CAAC;IAPD;QAAC,+EAAS,CAAC;YACT,QAAQ,EAAE,WAAW;YACrB,kCAAyC;SAC1C,CAAC;;0BAAA;IAIF,yBAAC;AAAD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;ACTyC;AAEZ;AACyB;AAGf;AAIxC;IAGE,qBAAoB,IAAW;QAAX,SAAI,GAAJ,IAAI,CAAO;QAFvB,YAAO,GAAW,cAAc,CAAC;IAER,CAAC;IAElC,yBAAG,GAAH;QACE,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC5B,IAAI,cAAc;QAChB,wEAAwE;QACxE,IAAI,CAAC,IAAI;aACN,GAAG,CAAC,CAAC,KAAG,IAAI,CAAC,OAAS,CAAC,EACpB,EAAC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAC,CAAC;aAChC,GAAG,CAAC,OAAO,CAAC,CAAC;QAElB,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC5B,MAAM,CAAC,cAAc,CAAC;IACxB,CAAC;IAEO,gCAAU,GAAlB;QACE,IAAI,OAAO,GAAG,IAAI,8DAAO,EAAE,CAAC;QAC5B,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,kBAAkB,CAAC,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,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,KAAK,EAAC,CAAC;YAC/D,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACzB,KAAI,CAAC,aAAa,GAAG,UAAU,CAAC;YAEhC,IAAM,WAAW,GAAG,EAAE,CAAC;YACvB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;YAC1C,KAAI,CAAC,eAAe,GAAG,WAAW,CAAC;QACrC,CAAC,CAAC,CAAC;QAEL,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC;IA5DH;QAAC,+EAAS,CAAC;YACT,QAAQ,EAAE,YAAY;YACtB,kCAAqC;SACtC,CAAC;;0BAAA;IA0DF,yBAAC;;AAAD,CAAC;;;;;;;;;;AC/DD;IAAA;IAGA,CAAC;IAAD,gBAAC;AAAD,CAAC;;;;;;;;;ACND;AAAA,mFAAmF;AACnF,8FAA8F;AAC9F,yEAAyE;AACzE,+EAA+E;AAExE,IAAM,WAAW,GAAG;IACzB,UAAU,EAAE,KAAK;CAClB,CAAC;;;;;;;;ACPF,sBAAsB,kBAAkB,KAAK,C;;;;;;;ACA7C,klCAAklC,OAAO,kI;;;;;;;ACAzlC,uGAAuG,6f;;;;;;;ACAvG,iE","file":"main.bundle.js","sourcesContent":["import { Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'dashboard',\r\n templateUrl: './dashboard.component.html'\r\n})\r\n\r\nexport class DashboardComponent {\r\n\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/dashboard.component.ts","import { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs/Rx';\r\nimport 'rxjs/add/operator/map'\r\nimport { Http, Response, Headers } from '@angular/http';\r\n\r\nimport { LineData } from './line-data';\r\nimport { GraphData } from './graph-data';\r\nimport { LabelData } from './label-data';\r\n\r\n@Injectable()\r\nexport class DataService {\r\n private baseUrl: string = '/webapi/data';\r\n\r\n constructor(private http : Http){}\r\n\r\n get(): Observable {\r\n console.log('Getting data');\r\n let lineChartData$ =\r\n //( {data: [65, 59, 80, 81, 56, 55, 40], label: 'Series A'} );\r\n this.http\r\n .get((`${this.baseUrl}`)\r\n , {headers: this.getHeaders()})\r\n .map(mapData);\r\n\r\n console.log(lineChartData$);\r\n return lineChartData$;\r\n }\r\n\r\n private getHeaders(){\r\n let headers = new Headers();\r\n headers.append('Accept', 'application/json');\r\n return headers;\r\n }\r\n}\r\n\r\nfunction mapData(response:Response): GraphData {\r\n console.log('Mapping data', GraphData);\r\n let nums = response.json().map(toData);\r\n let times = response.json().map(timeToData)\r\n\r\n console.log(nums);\r\n\r\n let line:LineData = ({data: nums, label: \"Series A\"});\r\n let label:LabelData = ({data: times});\r\n console.log(line);\r\n let graph:GraphData = ({lines:line,labels:label});\r\n return graph;\r\n}\r\n\r\nfunction toData(r:any){\r\n let num = r.TOE1;\r\n console.log('Parsed Data:', num);\r\n return num;\r\n}\r\n\r\nfunction timeToData(r:any){\r\n let times = r.time.substring(11,18);\r\n console.log('Parsed Time:', times);\r\n return times;\r\n}\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/data.service.ts","function webpackEmptyContext(req) {\n\tthrow new Error(\"Cannot find module '\" + req + \"'.\");\n}\nwebpackEmptyContext.keys = function() { return []; };\nwebpackEmptyContext.resolve = webpackEmptyContext;\nmodule.exports = webpackEmptyContext;\nwebpackEmptyContext.id = 385;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src async\n// module id = 385\n// module chunks = 1","import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\r\nimport { enableProdMode } from '@angular/core';\r\nimport { environment } from './environments/environment';\r\nimport { AppModule } from './app/app.module';\r\n\r\nif (environment.production) {\r\n enableProdMode();\r\n}\r\n\r\nplatformBrowserDynamic().bootstrapModule(AppModule);\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/main.ts","import { NgModule } from '@angular/core';\r\nimport { RouterModule, Routes } from '@angular/router';\r\nimport { DashboardComponent } from './dashboard.component';\r\n\r\nconst routes: Routes = [\r\n { path: '', redirectTo: '/dashboard', pathMatch: 'full' },\r\n { path: 'dashboard', component: DashboardComponent },\r\n];\r\n@NgModule({\r\n imports: [ RouterModule.forRoot(routes) ],\r\n exports: [ RouterModule ]\r\n})\r\nexport class AppRoutingModule {}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/app-routing.module.ts","import { Component } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-root',\r\n templateUrl: './app.component.html',\r\n styleUrls: ['./app.component.css']\r\n})\r\nexport class AppComponent {\r\n title = 'Energie';\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/app.component.ts","import { BrowserModule } from '@angular/platform-browser';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { HttpModule } from '@angular/http';\r\nimport { ChartsModule } from 'ng2-charts/ng2-charts';\r\n\r\nimport { AppRoutingModule } from './app-routing.module';\r\n\r\nimport { AppComponent } from './app.component';\r\nimport { LineChartComponent } from './chart.component';\r\nimport { DashboardComponent } from './dashboard.component';\r\n\r\nimport { DataService } from './data.service';\r\n\r\n@NgModule({\r\n declarations: [\r\n AppComponent,\r\n LineChartComponent,\r\n DashboardComponent\r\n ],\r\n imports: [\r\n BrowserModule,\r\n FormsModule,\r\n HttpModule,\r\n ChartsModule,\r\n AppRoutingModule\r\n ],\r\n providers: [DataService],\r\n bootstrap: [AppComponent]\r\n})\r\nexport class AppModule { }\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/app.module.ts","import { Component, OnInit } from '@angular/core';\r\nimport { DataService } from './data.service';\r\n\r\nimport { LineData } from './line-data';\r\n\r\n@Component({\r\n selector: 'line-chart',\r\n templateUrl: './chart.component.html'\r\n})\r\nexport class LineChartComponent implements OnInit {\r\n // lineChart\r\n public lineChartData:Array = [\r\n {data: [1,0,0,0,0,0,1], label: 'Series A'}\r\n ];\r\n public lineChartLabels:Array = ['', '', '', '', '', '', ''];\r\n public lineChartOptions:any = {\r\n responsive: true,\r\n title: {\r\n display: true,\r\n position: 'left',\r\n text: 'Watt'\r\n }\r\n };\r\n public lineChartColors:Array = [\r\n { // grey\r\n backgroundColor: 'rgba(148,159,177,0.2)',\r\n borderColor: 'rgba(148,159,177,1)',\r\n pointBackgroundColor: 'rgba(148,159,177,1)',\r\n pointBorderColor: '#fff',\r\n pointHoverBackgroundColor: '#fff',\r\n pointHoverBorderColor: 'rgba(148,159,177,0.8)'\r\n }\r\n ];\r\n public lineChartLegend:boolean = true;\r\n public lineChartType:string = 'line';\r\n\r\n // events\r\n public chartClicked(e:any):void {\r\n //console.log(e);\r\n }\r\n\r\n public chartHovered(e:any):void {\r\n //console.log(e);\r\n }\r\n\r\n constructor(private dataService: DataService) {}\r\n\r\n ngOnInit(): void {\r\n\r\n this.dataService\r\n .get()\r\n .subscribe(res => {\r\n console.log(res);\r\n\r\n const newDataSet = [];\r\n const newLine = {data: res.lines.data, label: res.lines.label};\r\n newDataSet.push(newLine);\r\n this.lineChartData = newDataSet;\r\n\r\n const newDataSet2 = [];\r\n newDataSet2.push(res.labels.data.slice());\r\n this.lineChartLabels = newDataSet2;\r\n });\r\n\r\n console.log(\"Init\");\r\n }\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/chart.component.ts","import { LineData } from './line-data';\r\nimport { LabelData } from './label-data';\r\n\r\nexport class GraphData {\r\n public lines: LineData;\r\n public labels: LabelData;\r\n}\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/app/graph-data.ts","// The file contents for the current environment will overwrite these during build.\r\n// The build system defaults to the dev environment which uses `environment.ts`, but if you do\r\n// `ng build --env=prod` then `environment.prod.ts` will be used instead.\r\n// The list of which env maps to which file can be found in `angular-cli.json`.\r\n\r\nexport const environment = {\r\n production: false\r\n};\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/environments/environment.ts","module.exports = \"h1 {\\r\\n\\tcolor: blue;\\r\\n}\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/app.component.css\n// module id = 666\n// module chunks = 1","module.exports = \"
\\r\\n\\r\\n \\r\\n\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n

{{title}} Avans

\\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n\\r\\n
\\r\\n
\\r\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/app.component.html\n// module id = 667\n// module chunks = 1","module.exports = \"
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/chart.component.html\n// module id = 668\n// module chunks = 1","module.exports = \"
\\r\\n\\t\\r\\n
\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/app/dashboard.component.html\n// module id = 669\n// module chunks = 1"],"sourceRoot":""} \ No newline at end of file diff --git a/mean-app/src/app/chart.component.ts b/mean-app/src/app/chart.component.ts index eea15cc..35d4bca 100644 --- a/mean-app/src/app/chart.component.ts +++ b/mean-app/src/app/chart.component.ts @@ -57,7 +57,9 @@ export class LineChartComponent implements OnInit { newDataSet.push(newLine); this.lineChartData = newDataSet; - this.lineChartLabels = res.labels.data.slice(); + const newDataSet2 = []; + newDataSet2.push(res.labels.data.slice()); + this.lineChartLabels = newDataSet2; }); console.log("Init");