Commit aa583ae0 authored by Pithon Kabiro's avatar Pithon Kabiro
Browse files

New function: test drawing of scatter plot

Create a temporary function that wraps the scatter plot drawing logic
parent 67048cd2
Showing with 27 additions and 10 deletions
+27 -10
...@@ -662,12 +662,19 @@ const drawScatterPlotHC = function ( ...@@ -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_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 SERIES_2_SYMBOL = `${PHENOMENON_SYMBOL_SERIES_2}`;
const MARKER_RADIUS = 2;
Highcharts.chart("chart-scatter-plot", { Highcharts.chart("chart-scatter-plot", {
chart: { chart: {
type: "scatter", type: "scatter",
zoomType: "xy", zoomType: "xy",
}, },
boost: {
useGPUTranslations: true,
usePreAllocated: true,
},
title: { title: {
text: CHART_TITLE, text: CHART_TITLE,
}, },
...@@ -721,21 +728,24 @@ const drawScatterPlotHC = function ( ...@@ -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: { legend: {
layout: "vertical", enabled: false,
align: "left",
verticalAlign: "top",
x: 100,
y: 70,
floating: true,
backgroundColor: Highcharts.defaultOptions.chart.backgroundColor,
borderWidth: 1,
}, },
plotOptions: { plotOptions: {
scatter: { scatter: {
marker: { marker: {
radius: 5, radius: MARKER_RADIUS,
states: { states: {
hover: { hover: {
enabled: true, enabled: true,
...@@ -782,7 +792,10 @@ const drawScatterPlotHC = function ( ...@@ -782,7 +792,10 @@ const drawScatterPlotHC = function (
}); });
}; };
(async () => { /**
* Test drawing of scatter plot chart
*/
const drawScatterPlotHCTest = async function () {
// Input array - building, sensor, samplingRate // Input array - building, sensor, samplingRate
const sensorsOfInterestArr = [ const sensorsOfInterestArr = [
["weather_station_521", "outside_temp", "60min"], ["weather_station_521", "outside_temp", "60min"],
...@@ -807,6 +820,10 @@ const drawScatterPlotHC = function ( ...@@ -807,6 +820,10 @@ const drawScatterPlotHC = function (
formatSTAResponseForLineChartOrScatterPlot(obsSensorTwoArr), formatSTAResponseForLineChartOrScatterPlot(obsSensorTwoArr),
formatDatastreamMetadataForChart(metadataSensorTwo) formatDatastreamMetadataForChart(metadataSensorTwo)
); );
};
(async () => {
await drawScatterPlotHCTest();
})(); })();
export { export {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment