Einlesen und Anzeigen getrennt
Einlesen per HTPP (nicht mehr MQTT)
This commit is contained in:
@@ -49,7 +49,7 @@ function renderCharts(apiData) {
|
||||
|
||||
// Konvertiere Timestamps in Millisekunden
|
||||
const timestamps = data.map(d => {
|
||||
const [date, time] = d.datetime.split(' ');
|
||||
const [date, time] = d.dateTime.split(' ');
|
||||
return new Date(date + 'T' + time).getTime();
|
||||
});
|
||||
|
||||
@@ -80,7 +80,7 @@ function renderCharts(apiData) {
|
||||
legend: { enabled: true },
|
||||
series: [{
|
||||
name: 'Temperatur',
|
||||
data: data.map((d, i) => [timestamps[i], d.temperature]),
|
||||
data: data.map((d, i) => [timestamps[i], d.outTemp]),
|
||||
color: '#ff6b6b',
|
||||
lineWidth: 2
|
||||
}],
|
||||
@@ -101,7 +101,7 @@ function renderCharts(apiData) {
|
||||
legend: { enabled: true },
|
||||
series: [{
|
||||
name: 'Luftfeuchtigkeit',
|
||||
data: data.map((d, i) => [timestamps[i], d.humidity]),
|
||||
data: data.map((d, i) => [timestamps[i], d.outHumidity]),
|
||||
color: '#4ecdc4',
|
||||
lineWidth: 2
|
||||
}],
|
||||
@@ -122,7 +122,7 @@ function renderCharts(apiData) {
|
||||
legend: { enabled: true },
|
||||
series: [{
|
||||
name: 'Luftdruck',
|
||||
data: data.map((d, i) => [timestamps[i], d.pressure]),
|
||||
data: data.map((d, i) => [timestamps[i], d.barometer]),
|
||||
color: '#95e1d3',
|
||||
lineWidth: 2
|
||||
}],
|
||||
@@ -163,12 +163,12 @@ function renderCharts(apiData) {
|
||||
legend: { enabled: true },
|
||||
series: [{
|
||||
name: 'Windgeschwindigkeit',
|
||||
data: data.map((d, i) => [timestamps[i], d.wind_speed]),
|
||||
data: data.map((d, i) => [timestamps[i], d.windSpeed]),
|
||||
color: '#f38181',
|
||||
lineWidth: 2
|
||||
}, {
|
||||
name: 'Böen',
|
||||
data: data.map((d, i) => [timestamps[i], d.wind_gust]),
|
||||
data: data.map((d, i) => [timestamps[i], d.windGust]),
|
||||
color: '#aa96da',
|
||||
lineWidth: 2,
|
||||
dashStyle: 'dash'
|
||||
@@ -178,7 +178,7 @@ function renderCharts(apiData) {
|
||||
|
||||
// Windrichtung
|
||||
Highcharts.chart('wind-dir-chart', {
|
||||
chart: { type: 'line', height: DEFAULT_CHART_HEIGHT, spacingRight: 20 },
|
||||
chart: { type: 'scatter', height: DEFAULT_CHART_HEIGHT, spacingRight: 20 },
|
||||
title: { text: '🧭 Windrichtung (°)' },
|
||||
xAxis: {
|
||||
type: 'datetime',
|
||||
@@ -195,7 +195,7 @@ function renderCharts(apiData) {
|
||||
legend: { enabled: true },
|
||||
series: [{
|
||||
name: 'Windrichtung',
|
||||
data: data.map((d, i) => [timestamps[i], d.wind_dir || 0]),
|
||||
data: data.map((d, i) => [timestamps[i], d.windDir || 0]),
|
||||
color: '#f39c12',
|
||||
lineWidth: 2
|
||||
}],
|
||||
|
||||
Reference in New Issue
Block a user