From 9d2a363c662ae2a27db15fc199c4f7ae3c8c477c Mon Sep 17 00:00:00 2001
From: Pithon Kabiro <pithon.kabiro@hft-stuttgart.de>
Date: Thu, 24 Jun 2021 10:47:27 +0200
Subject: [PATCH] Add documentation for mapping function; line chart tweaks

---
 public/js/appChart.js | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/public/js/appChart.js b/public/js/appChart.js
index 2239572..86ff90a 100644
--- a/public/js/appChart.js
+++ b/public/js/appChart.js
@@ -6,6 +6,13 @@
 
 export const BASE_URL = "http://193.196.39.91:8080/frost-icity-tp31/v1.1";
 
+/**
+ * Retrieve the datastream ID that corresponds to a particular building
+ * @param {*} buildingNumber Integer representing the building ID
+ * @param {*} phenomenon String representing the phenomenon of interest
+ * @param {*} samplingRate String representing the sampling rate of the observations
+ * @returns {Number} Datastream corresponding to the input building
+ */
 export const getDatastreamIdFromBuildingNumber = function (
   buildingNumber,
   phenomenon,
@@ -138,7 +145,7 @@ export const formatSTAResponseForHeatMap = function (obsArray) {
 
 /**
  * Draw a heatmap using Highcharts library
- * @param {Array} obsArray Response from SensorThings API
+ * @param {Array} formattedObsArrayForHeatmap Response from SensorThings API formatted for use in a heatmap
  * @returns {Object} Highcharts library heatmap object
  */
 export const drawHeatMapHC = function (formattedObsArrayForHeatmap) {
@@ -248,7 +255,7 @@ export const formatSTAResponseForLineChart = function (obsArray) {
 
 /**
  * Draw a line chart using Highcharts library
- * @param {Array} obsArray - Response from SensorThings API
+ * @param {Array} formattedObsArrayForLineChart - Response from SensorThings API formatted for use in a line chart
  * @returns {Object} Highcharts library line chart object
  */
 export const drawLineChartHC = function (formattedObsArrayForLineChart) {
@@ -263,7 +270,13 @@ export const drawLineChartHC = function (formattedObsArrayForLineChart) {
     },
 
     title: {
-      text: "AAPL Stock Price",
+      text: "Inlet flow (Vorlauf)",
+      "align": "left",
+    },
+
+    subtitle: {
+      text: "Temperature variation by hour in 2020",
+      align: "left",
     },
 
     series: [
-- 
GitLab