Temperature and Rate of Rise (RoR) chart component used across the application.
File: static/js/roast-chart.js
Used by:
roast_live.html- Real-time updates during roastingroast_detail.html- Historical view of completed roastsroast_edit.html- View while editing roast data
- Blue line showing temperature over time
- Scale: 0-200°C
- Point style: circle
- Orange line showing rate of rise
- Scale: Fixed -10 to 40
- Supports negative values within fixed range
- Filtered: Only plots values <= 30 to avoid spikes
- Linear scale using seconds
- Live mode: 8 minutes default, extends as needed
- Historical mode: Exact roast duration
- Vertical annotations for key events (FC, SC, etc.)
- Labels positioned inside chart (yAdjust: 15)
- Events: Yellowing, First Crack, Second Crack
Power and fan settings are shown as stepped, dashed bands inside the chart using a dedicated axis (y-pf).
- Power: Brown shaded band
- Fan: Green shaded band
- Both use stepped lines with fill for band appearance
Initialize the chart component.
RoastChart.init({
isLive: true,
chartContainerId: 'roastCurveChart'
});Load historical data (detail/edit pages).
RoastChart.initFromData(tempCurve, keyTimings, roastDuration);Add real-time data point (live page).
RoastChart.addDataPoint({
time_seconds: 180,
temperature: 165,
ror: 12.5,
fan_setting: 9,
power_setting: 5
});Add event annotation.
RoastChart.addEventMarker('First Crack Start', 542);layout: {
padding: { top: 30 }
}legend: {
position: 'top',
labels: {
usePointStyle: true,
pointStyleWidth: 8,
boxHeight: 8,
font: { size: 11 }
}
}.chart-container-large {
height: 370px;
}