From af8484475c54b2a8d877160e35acc92a72b8a956 Mon Sep 17 00:00:00 2001 From: Stefania Martziou Date: Thu, 7 Mar 2024 00:21:26 +0200 Subject: [PATCH] Fixed the treemaps dataseries to include the labels and added the squarified layout as a default --- Application/src/main/resources/static/js/CDF_chart_handler.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Application/src/main/resources/static/js/CDF_chart_handler.js b/Application/src/main/resources/static/js/CDF_chart_handler.js index 395c134..c84ac47 100644 --- a/Application/src/main/resources/static/js/CDF_chart_handler.js +++ b/Application/src/main/resources/static/js/CDF_chart_handler.js @@ -465,6 +465,8 @@ function convertToValidHighchartJson(responseData, originJson){ if(seriesInstance.type == "treemap") { + // Add the squarified layout algorithm as a default in treemaps + seriesInstance.layoutAlgorithm = 'squarified'; seriesInstance.data = []; for (let dataIndex = 0; dataIndex < responseData.series[index].data.length; dataIndex++) { @@ -474,7 +476,7 @@ function convertToValidHighchartJson(responseData, originJson){ seriesInstance.data.push({ name: dataName, value: dataValue, colorValue: dataValue }); } } - if(seriesInstance.type == "dependencywheel" || seriesInstance.type == "sankey") + else if(seriesInstance.type == "dependencywheel" || seriesInstance.type == "sankey") { seriesInstance.data = responseData.series[index].data; seriesInstance.keys = responseData.series[index].keys;