*** WIP WIP *** All charts work now

This commit is contained in:
rxf
2023-04-02 15:34:49 +02:00
parent a1c1c93bc4
commit 5082eb408f
5 changed files with 25 additions and 12 deletions
+1 -1
View File
@@ -171,7 +171,7 @@ export async function addSensorID2chart(chart, sensor, width) {
'font-weight': 'bold', 'font-weight': 'bold',
}) })
.attr({ .attr({
zIndex: 5, zIndex: 2,
}).add(); }).add();
} }
+15 -8
View File
@@ -6,11 +6,11 @@ import * as map from "./map.js";
// table to distribute the different charts // table to distribute the different charts
export const tabtable = [ export const tabtable = [
{id: 'kartentab', type: 'map', container: 'map', func: map.showMap, div: null, dformat: null}, {id: 'kartentab', type: 'map', container: 'map', func: map.showMap, div: null, dformat: null},
{id: 'livetab', type: 'live', container: 'dlive', func: showChart, div: 100, dformat: "dd.LL - HH:mm:ss"}, {id: 'livetab', type: 'live', container: 'dlive', func: showChart, div: 2, dformat: "dd.LL - HH:mm:ss"},
{id: 'houravgtab', type: 'havg', container: 'dhour', func: showChart, div: 10, dformat: "dd.LL - HH'h'"}, {id: 'houravgtab', type: 'havg', container: 'dhour', func: showChart, div: 1, dformat: "dd.LL - HH'h'"},
{id: 'dayavgtab', type: 'davg', container: 'dday', func: showChart, div: 10, dformat: "dd.LL"}, {id: 'dayavgtab', type: 'davg', container: 'dday', func: showChart, div: 1, dformat: "dd.LL"},
{id: 'daynighttab', type: 'daynight', container: 'ddaynight', func: showChart, div: 10, dformat: "dd.LL"}, {id: 'daynighttab', type: 'daynight', container: 'ddaynight', func: showChart, div: 1, dformat: "dd.LL"},
{id: 'ldentab', type: 'lden', container: 'dlden', func: showChart, div: 10, dformat: "dd.LL"}, {id: 'ldentab', type: 'lden', container: 'dlden', func: showChart, div: 1, dformat: "dd.LL"},
] ]
@@ -24,11 +24,15 @@ export async function showChart(params, typ, container) {
if(((typ === 'daynight') && (this.series.name.startsWith('N'))) || (typ === 'lden')) { if(((typ === 'daynight') && (this.series.name.startsWith('N'))) || (typ === 'lden')) {
fmt = `${d.toFormat('dd')}/${d1.toFormat('dd.LL')}` fmt = `${d.toFormat('dd')}/${d1.toFormat('dd.LL')}`
} }
let y = Math.round(this.y * item.div) / item.div if(this.series.name === 'Peaks') {
item.div = 0
}
return '<div style="border: 2px solid ' + this.point.color + '; padding: 3px;">' + return '<div style="border: 2px solid ' + this.point.color + '; padding: 3px;">' +
fmt + '<br />' + fmt + '<br />' +
'<span style="color: ' + this.point.color + '">&#9679;&nbsp;</span>' + '<span style="color: ' + this.point.color + '">&#9679;&nbsp;</span>' +
this.series.name + ':&nbsp; <b>' + y + '</b></div>' this.series.name + ':&nbsp; <b>' +
Highcharts.numberFormat(this.y,item.div) +
'</b></div>'
} }
} }
} }
@@ -62,7 +66,10 @@ export async function showChart(params, typ, container) {
erg.options.xAxis.labels.formatter = xformat erg.options.xAxis.labels.formatter = xformat
erg.options.tooltip.formatter = form erg.options.tooltip.formatter = form
let chr = Highcharts.chart(container, erg.options, function (chart) { let chr = Highcharts.chart(container, erg.options, function (chart) {
utils.addSensorID2chart(chart, {sid: erg.params.sensorid, indoor: erg.params.indoor}, document.getElementById(container).offsetWidth) utils.addSensorID2chart(chart, {
sid: erg.params.sensorid,
indoor: erg.params.indoor
}, document.getElementById(container).offsetWidth)
}) })
if((typ === 'havg') || (typ === 'davg')) { if((typ === 'havg') || (typ === 'davg')) {
+4
View File
@@ -167,4 +167,8 @@ footer #author #versn {
border: red solid 2px; border: red solid 2px;
} }
.highcharts-tooltip {
zIndex: 5;
}
/*# sourceMappingURL=style.css.map */ /*# sourceMappingURL=style.css.map */
+1 -1
View File
@@ -1 +1 @@
{"version":3,"sourceRoot":"","sources":["style.sass"],"names":[],"mappings":"AAWA;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;;;AAEF;EACE;EACA;EACA;EAEA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE,kBA7BoB;;AA+BpB;EACE;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;;AAEF;EACE;EACA;;;AAEJ;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAEF;EACE;EACA;;AACA;EACE;;;AAEN;EACE;EAEA;EACA;EACA,eA3Ec;EA4Ed;EACA;EACA;;AAEA;EACE;EACA;EACA;;AACF;EACE;EACA;;;AAEJ;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AACF;EACE;EACA;;;AAEJ;EACE,kBA/FoB;;AAiGpB;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAEF;EACE;;;AAGN;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;;;AAEF;EACE;;;AAEF;EACE;EAEA;;;AAEF;EACE;;;AAEF;EACE","file":"style.css"} {"version":3,"sourceRoot":"","sources":["style.sass"],"names":[],"mappings":"AAWA;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;;;AAEF;EACE;EACA;EACA;EAEA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE,kBA7BoB;;AA+BpB;EACE;EACA;EACA;EACA;;AAEF;EACE;EACA;EACA;EACA;;AAEF;EACE;EACA;;;AAEJ;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AAEF;EACE;EACA;;AACA;EACE;;;AAEN;EACE;EAEA;EACA;EACA,eA3Ec;EA4Ed;EACA;EACA;;AAEA;EACE;EACA;EACA;;AACF;EACE;EACA;;;AAEJ;EACE;EACA;EACA;EACA;;AAEA;EACE;EACA;;AACF;EACE;EACA;;;AAEJ;EACE,kBA/FoB;;AAiGpB;EACE;EACA;EACA;EACA;EACA;EACA;;AAEA;EACE;;AAEF;EACE;;;AAGN;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;;;AAEF;EACE;;;AAEF;EACE;EACA;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE","file":"style.css"}
+4 -2
View File
@@ -152,11 +152,13 @@ footer
#dlive, #dhour, #dday, #ddaynight, #dlden, #dpeak1, #dpeak2 #dlive, #dhour, #dday, #ddaynight, #dlden, #dpeak1, #dpeak2
width: 100% width: 100%
// height: 100%
margin: auto margin: auto
#dialogError #dialogError
color: red color: red
.modal-content .modal-content
border: red solid 2px border: red solid 2px
.highcharts-tooltip
zIndex: 5