$ RENDER_CHART --type=line --source=sensor-readings.json
SPEC_BREAKDOWN
What this chart teaches
- data.url
- Loads JSON from a relative path. Vega-Lite fetches it at render time - no bundling needed.
- mark: "line" + point layer
- The primary mark draws a continuous line. A second layer adds dots at each data point.
- encoding.x - temporal
- Field type
temporaltells Vega-Lite the field is a date/time string, enabling time-aware axis formatting. - encoding.y - quantitative
- Numeric measurements.
scale: {zero: false}stops the y-axis from forcing a zero baseline. - tooltip
- Hover any point. The tooltip array controls which fields appear and how they are formatted.