How to display sensor data without timestamp in csv format inside a time series panel?

Combining hint from @yosiasz, CVS plugin and eCharts plugin, I have been able to produce this panel :slight_smile:

Timestamps are created on the fly.

It does not use Grafana time range (yet).

Here is the code:

var voltages = data.series[0].fields[0].values.buffer;
const tick = 10; // seconds
let date = [];
var t = new Date();
t.setSeconds(t.getSeconds() - tick*voltages.length);
for (let i = 0; i < voltages.length; i++) {
  t.setSeconds(t.getSeconds() + 10);
  date.push(t.toLocaleString());
}

return {
  tooltip: {
    trigger: 'axis',
  },
  xAxis: {
    type: 'category',
    data: date
  },
  yAxis: {
    type: 'value',
  },
  series: [
    {
      name: 'tension',
      type: 'line',
      data: voltages
    }
  ]
};

1 Like