-
Grafana v12.4.0 on Docker 28.5.1 on Debian
12.12 -
using Echarts (Business charts) plugin to create chart displaying wind direction and wind speed (y axis) over time (x axis)
-
using code snippets found here in * previous threads enhanced by google AI
-
II can only see what is on the attached picture
const series = context.panel.data.series.map((s) => {
const windSpeedField = s.fields.find((f) => f.name === 'windspeedmph');
const windDirField = s.fields.find((f) => f.name === 'winddir');
const timeField = s.fields.find((f) => f.name === 'Time');
// Skip this series if any required field is missing to avoid the "undefined" error
if (!windSpeedField || !windDirField || !timeField) return { data: [] };
const windspeedmph = windSpeedField.values;
const winddir = windDirField.values;
const Time = timeField.values;
return {
name: s.name,
type: 'line',
symbol: 'path://M31 24.7343L21.7917 24.7343V0L9.20826 0L9.20826 24.7343H0L15.5 45L31 24.7343Z',
symbolSize: 15,
lineStyle: { width: 0.5 },
data: Time.map((d, i) => ({
value: [d, windspeedmph[i]],
symbolRotate: winddir[i]
}))
};
});
return {
xAxis: { type: 'time' }, // Note: lower-case 'time' is standard for ECharts
yAxis: { type: 'value' },
visualMap: {
orient: 'horizontal',
left: 'center',
min: 0,
max: 25,
text: ['High', 'Low'],
dimension: 1,
inRange: {
color: ['#65B581', '#FFCE34', '#FD665F']
}
},
series: series
};


