From aa583ae0123f30fca5eace4a41123f96491f1d85 Mon Sep 17 00:00:00 2001 From: Pithon Kabiro <pithon.kabiro@hft-stuttgart.de> Date: Tue, 14 Sep 2021 16:25:05 +0200 Subject: [PATCH] New function: test drawing of scatter plot Create a temporary function that wraps the scatter plot drawing logic --- public/js/appChart.js | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/public/js/appChart.js b/public/js/appChart.js index 81de454..fe00205 100644 --- a/public/js/appChart.js +++ b/public/js/appChart.js @@ -662,12 +662,19 @@ const drawScatterPlotHC = function ( const SERIES_2_TEXT_COLOR = `rgb(${SERIES_2_SYMBOL_COLOR_RGB_ELEMENTS})`; // remove transparency from symbol color for a more "intense" color const SERIES_2_SYMBOL = `${PHENOMENON_SYMBOL_SERIES_2}`; + const MARKER_RADIUS = 2; + Highcharts.chart("chart-scatter-plot", { chart: { type: "scatter", zoomType: "xy", }, + boost: { + useGPUTranslations: true, + usePreAllocated: true, + }, + title: { text: CHART_TITLE, }, @@ -721,21 +728,24 @@ const drawScatterPlotHC = function ( }, ], + // legend: { + // layout: "vertical", + // align: "left", + // verticalAlign: "top", + // x: 100, + // y: 70, + // floating: true, + // backgroundColor: Highcharts.defaultOptions.chart.backgroundColor, + // borderWidth: 1, + // }, legend: { - layout: "vertical", - align: "left", - verticalAlign: "top", - x: 100, - y: 70, - floating: true, - backgroundColor: Highcharts.defaultOptions.chart.backgroundColor, - borderWidth: 1, + enabled: false, }, plotOptions: { scatter: { marker: { - radius: 5, + radius: MARKER_RADIUS, states: { hover: { enabled: true, @@ -782,7 +792,10 @@ const drawScatterPlotHC = function ( }); }; -(async () => { +/** + * Test drawing of scatter plot chart + */ +const drawScatterPlotHCTest = async function () { // Input array - building, sensor, samplingRate const sensorsOfInterestArr = [ ["weather_station_521", "outside_temp", "60min"], @@ -807,6 +820,10 @@ const drawScatterPlotHC = function ( formatSTAResponseForLineChartOrScatterPlot(obsSensorTwoArr), formatDatastreamMetadataForChart(metadataSensorTwo) ); +}; + +(async () => { + await drawScatterPlotHCTest(); })(); export { -- GitLab