From 2136406a28608e8d3731373eaa808e91e0b6d21a Mon Sep 17 00:00:00 2001 From: Kristjan Komlosi Date: Tue, 14 Jul 2020 11:12:43 +0200 Subject: [PATCH] changed JS to match 1c49490 --- terahz/static/frontend.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/terahz/static/frontend.js b/terahz/static/frontend.js index e06b911..797c7ee 100644 --- a/terahz/static/frontend.js +++ b/terahz/static/frontend.js @@ -16,12 +16,13 @@ function graphSpectralData (obj, dom) { // graph spectral data in obj into dom var graphPoints = []; var graphXTicks = []; - const spectrum = 'ABCDEFGHRISJTUVWKL'; + for (var i = 0; i < spectrum.length; i++) { graphPoints.push([i, obj[spectrum[i]]]); graphXTicks.push([i, spectrum[i]]); } + const options = { grid: { color: 'white' }, xaxis: { ticks: graphXTicks } @@ -32,8 +33,8 @@ function graphSpectralData (obj, dom) { function fillTableData (obj) { // fill the obj data into HTML tables - Object.keys(obj[0]) - .forEach((element) => { $('#' + element + '_value').text(obj[0][element]); }); + Object.keys(obj[0]).forEach((element) => + { $('#' + element + '_value').text(obj[0][element]); }); $('#lx').text(obj[1]); $('#uva').text(obj[2][0]); $('#uvb').text(obj[2][1]);