Hello,
I am using plugins like:
- Apache ECharts plugin for Grafana | Grafana Labs
- Echarts plugin for Grafana | Grafana Labs
for data visualization.
When there is no data to be returned from the flux query the following message I got:
Can you please tell me, how should I modify the code related to the chart, to display more user friendly content?
This function does not run because there is no data:
const series = data.series.map((s, index) => {
const sData = s.fields.find((f) => f.type === ‘number’).values.buffer;
const sTime = s.fields.find((f) => f.type === ‘time’).values.buffer;return {
name: s.refId,
type: ‘line’,
showSymbol: false,
lineStyle: {
width: 1,
color: colors[mod(index, colors.length)],
},
data: sData.map((d, i) => [sTime[i], d.toFixed(2)]),
};
});
When I change the series to this one:
const series = ;
I got the right output like this:
How can I manage the value of the series to display empty content when there is no data to run the map function?
Thank you!