Chart Log Data

Charts GET /api/v1/device/logs with Apache ECharts. Keys are used only in this browser tab and are not stored.

Listed by GET /logs/series for the selected resolution, grouped by unit - this demo charts one unit (one y-axis) at a time. Sensors quiet for over 7 days are hidden.
Select a range and resolution. Original device timestamps are preserved.

Example JavaScript

Fetching log data and rendering it with ECharts:

// Discover what can be charted (names drive the sensor picker):
const series = await fetch(
  `${baseUrl}/api/v1/device/logs/series?resolution=10m`,
  { headers: { Authorization: `${providerKey}:${deviceKey}` } }
).then(r => r.json());

const end = Date.now();
const start = end - 6 * 60 * 60 * 1000;              // 6 hours

const res = await fetch(
  `${baseUrl}/api/v1/device/logs?start=${start}&end=${end}&resolution=10m`,
  { headers: { Authorization: `${providerKey}:${deviceKey}` } }
);
const data = await res.json();

const chart = echarts.init(document.getElementById('chart'));
chart.setOption({
  xAxis: { type: 'time' },
  yAxis: { type: 'value', scale: true },
  tooltip: { trigger: 'axis' },
  legend: {},
  series: Object.entries(data.series).map(([name, s]) => ({
    name,
    type: 'line',
    showSymbol: false,
    data: s.points.map(([time, value]) => [time, value]),
  })),
});

For other libraries the point format differs: Chart.js takes points.map(([x, y]) => ({ x, y })) on a time scale, and Plotly takes separate x and y arrays. Each series carries a type field (Tmp, pH, …) identifying the unit; this page charts one unit type at a time so all series share a y-axis. Values arrive in fixed canonical units (Tmp °C, ORP mV, Sal PSU, Flo LPH - full table in the API reference) regardless of the controller's display setting; convert client-side if you need °F or other units.