Peaks merged to havg/davg

utilities/chartoptions.js
   - removed chart height from global options

sensorspecials/noiseChart.js
   - changed sam texts /tile, subtitle)
This commit is contained in:
rxf
2023-04-04 14:42:49 +02:00
parent b6a8b1706c
commit 9ef468cf74
2 changed files with 82 additions and 83 deletions
+73 -73
View File
@@ -136,7 +136,7 @@ export const liveData = (params, values) => {
options.yAxis = [] options.yAxis = []
options.series[0] = series_LAeq options.series[0] = series_LAeq
options.series[1] = series_LAMin options.series[1] = series_LAMin
options.title.text = 'Noise level for one day' options.title.text = 'Noise levels last 24 hours'
options.subtitle.useHTML = true options.subtitle.useHTML = true
options.subtitle.text = '2.5min log. average values <br /> &nbsp' options.subtitle.text = '2.5min log. average values <br /> &nbsp'
options.series[2] = series_LAMax options.series[2] = series_LAMax
@@ -205,15 +205,26 @@ export const havgData = (params, values) => {
// options.xAxis.plotBands = utils.calcWeekends(data, true) // options.xAxis.plotBands = utils.calcWeekends(data, true)
options.xAxis.minTickInterval = 3600 * 1000 options.xAxis.minTickInterval = 3600 * 1000
options.yAxis = { options.yAxis = [
title: { {
text: 'dbA', title: {
useHTML: true, text: 'dbA',
}, useHTML: true,
min: utils.noise_ymin, },
tickAmount: 10, min: utils.noise_ymin,
gridLineColor: 'lightgray', tickAmount: 10,
} gridLineColor: 'lightgray'
}, {
title: {
text: 'Counts',
useHTML: true,
},
tickAmount: 10,
allowDecimals: false,
gridLineColor: 'lightgray',
opposite: true
}
]
options.series = [ options.series = [
{ {
name: 'Mean value LAeq', name: 'Mean value LAeq',
@@ -221,17 +232,28 @@ export const havgData = (params, values) => {
color: utils.colors.eq, color: utils.colors.eq,
type: 'column', type: 'column',
zIndex: 2, zIndex: 2,
}, yAxis: 0
] }, {
name: 'Peaks',
data: series2,
color: utils.colors.peaks,
type: 'column',
yAxis: 1
}
]
// options.plotOptions.column = {
// pointWidth: 8,
// groupPadding: 0.5
// }
options.plotOptions.column = { options.plotOptions.column = {
pointWidth: 8, pointWidth: 8,
groupPadding: 0.5 groupPadding: 0.1
} }
options.title.text = 'Noise hourly mean values'
options.subtitle.text = 'Hourly mean values of LAeq for each full hour <br />&nbsp' options.title.text = 'Hourly mean values / Peaks over ' + params.peak + ' dbA'
options.subtitle.text = 'Hourly mean values of LAeq for each full hour / Number of peaks per hour'
options.subtitle.useHTML = true options.subtitle.useHTML = true
options.chart.zoomType = 'x' options.chart.zoomType = 'x'
options.chart.height = 350
options.chart.resetZoomButton= { options.chart.resetZoomButton= {
position: { position: {
align: 'left', align: 'left',
@@ -241,27 +263,7 @@ export const havgData = (params, values) => {
relativeTo: 'chart' relativeTo: 'chart'
} }
// Calculate to plot peaks return { options: options, params: params}
let options2 = JSON.parse(JSON.stringify(options));
options2.series[0] = {
name: 'Peaks',
data: series2,
color: utils.colors.peaks,
type: 'column'
}
options2.title.text = 'Peaks more than ' + params.peak + ' dbA'
options2.subtitle.text = 'Number of exceedances per hour <br />&nbsp'
options2.yAxis = {
title: {
text: 'Counts',
useHTML: true,
},
tickAmount: 10,
allowDecimals: false,
gridLineColor: 'lightgray',
}
return { options: options, options2: options2, params: params}
} }
@@ -299,17 +301,28 @@ export const havgData = (params, values) => {
// } // }
options.chart.type = 'column' options.chart.type = 'column'
options.chart.height = 350
options.yAxis = { options.yAxis = [
title: { {
text: 'dbA', title: {
useHTML: true, text: 'dbA',
}, useHTML: true,
min: utils.noise_ymin, },
tickAmount: 10, min: utils.noise_ymin,
gridLineColor: 'lightgray', tickAmount: 10,
} gridLineColor: 'lightgray',
}, {
title: {
text: 'Counts',
useHTML: true,
},
tickAmount: 10,
allowDecimals: false,
gridLineColor: 'lightgray',
opposite: true
}
]
options.series = [ options.series = [
{ {
name: 'Mean value LAeq', name: 'Mean value LAeq',
@@ -317,14 +330,21 @@ export const havgData = (params, values) => {
color: utils.colors.eq, color: utils.colors.eq,
type: 'column', type: 'column',
zIndex: 2, zIndex: 2,
}, yAxis: 0
},{
name: 'Peaks',
data: series2,
color: utils.colors.peaks,
type: 'column',
yAxis: 1,
}
] ]
options.plotOptions.column = { options.plotOptions.column = {
pointWidth: 20, pointWidth: 20,
groupPadding: 0.1 groupPadding: 0.1
} }
options.title.text = 'Noise daily mean values' options.title.text = 'Daily mean values / Peaks over ' + params.peak + ' dbA'
options.subtitle.text = 'Daily mean values of LAeq for each full day <br />&nbsp' options.subtitle.text = 'Daily mean values of LAeq for each full day / Number of peaks per day'
options.subtitle.useHTML = true options.subtitle.useHTML = true
options.chart.zoomType = 'x' options.chart.zoomType = 'x'
options.chart.resetZoomButton = { options.chart.resetZoomButton = {
@@ -337,27 +357,7 @@ export const havgData = (params, values) => {
relativeTo: 'chart' relativeTo: 'chart'
} }
// Calculate to plot peaks return {options: options, params: params}
let options2 = JSON.parse(JSON.stringify(options));
options2.series[0] = {
name: 'Peaks',
data: series2,
color: utils.colors.peaks,
type: 'column'
}
options2.title.text = 'Peaks more than ' + params.peak + ' dbA'
options2.subtitle.text = 'Number of exceedances per day <br />&nbsp'
options2.yAxis = {
title: {
text: 'Counts',
useHTML: true,
},
tickAmount: 10,
allowDecimals: false,
gridLineColor: 'lightgray',
}
return {options: options, options2: options2, params: params}
} }
@@ -426,7 +426,7 @@ export const dayNightData = (params, values) => {
pointWidth: 20, pointWidth: 20,
groupPadding: 0.3 groupPadding: 0.3
} }
options.title.text = 'Noise Average values during the day and night hours' options.title.text = 'Average values during the day and night hours'
options.subtitle.text = 'Daily mean values of LAeq from 6h00 to 22h00 <br /> Nightly mean values of LAeq from 22h00 to 6h00' options.subtitle.text = 'Daily mean values of LAeq from 6h00 to 22h00 <br /> Nightly mean values of LAeq from 22h00 to 6h00'
options.subtitle.useHTML = true options.subtitle.useHTML = true
options.chart.zoomType = 'x' options.chart.zoomType = 'x'
@@ -501,7 +501,7 @@ export const ldenData = (params, values) => {
pointWidth: 20, pointWidth: 20,
groupPadding: 0.1 groupPadding: 0.1
} }
options.title.text = 'Noise L<sub>DEN</sub>-Index' options.title.text = 'L<sub>DEN</sub>-Index'
options.subtitle.text = 'Daily mean values of L<sub>DEN</sub>\-Index' options.subtitle.text = 'Daily mean values of L<sub>DEN</sub>\-Index'
options.subtitle.useHTML = true options.subtitle.useHTML = true
options.chart.zoomType = 'x' options.chart.zoomType = 'x'
+9 -10
View File
@@ -7,7 +7,6 @@ export function createGlobObtions() {
// Options, die für alle Plots identisch sind // Options, die für alle Plots identisch sind
let globObject = { let globObject = {
chart: { chart: {
height: 600,
spacingRight: 20, spacingRight: 20,
spacingLeft: 20, spacingLeft: 20,
spacingTop: 25, spacingTop: 25,
@@ -20,15 +19,15 @@ export function createGlobObtions() {
}, },
type: 'line', type: 'line',
borderWidth: '2', borderWidth: '2',
events: { // events: {
selection: function (event) { // selection: function (event) {
if (event.xAxis) { // if (event.xAxis) {
doUpdate = false; // doUpdate = false;
} else { // } else {
doUpdate = true; // doUpdate = true;
} // }
} // }
} // }
}, },
title: { title: {
align: 'left', align: 'left',