drawGraph method
- Canvas canvas
Draws the complete graph.
canvas
is the canvas to draw on.
Implementation
drawGraph(Canvas canvas) {
auto = PrefService.getBool('liveInterpretations') ?? true;
highlight = PrefService.getBool('liveHighlight') ?? true;
fhr2Offset = PrefService.getInt('fhr2Offset') ?? 0;
if (test.lengthOfTest! > 3600) {
auto = false;
highlight = false;
gridPerMin = 1;
}
drawXAxis(canvas);
drawYAxis(canvas);
drawTocoXAxis(canvas);
drawTocoYAxis(canvas);
//drawBPMLine(canvas, /*interpretations.baselineBpmList*/, graphBaseLine);
if (displayFhr != 2) {
drawBPMLine(canvas, test.bpmEntries!, graphBpmLine);
}
//drawBPMLine(canvas, [150, 159, 169, 179,179,166,156,144,134,131,131,142,150, 159, 169, 179,179,166,156,144,134,131,131,142,150, 159, 169, 179,179,166,156,144,134,131,131,142,150, 159, 169, 179,179,166,156,144,134,131,131,142,150, 159, 169, 179,179,166,156,144,134,131,131,142,150, 159, 169, 179,179,166,156,144,134,131,131,142], graphBpmLine);
if (displayFhr != 1) {
drawBPMLine(canvas, test.bpmEntries2!, graphBpmLine2,
bpmOffset: fhr2Offset);
}
drawBPMLine(canvas, test.mhrEntries!, graphBpmLine3);
drawMovements(canvas);
drawAutoMovements(canvas);
drawTocoLine(canvas, test.tocoEntries!, graphBpmLine);
drawTocoLine(canvas, test.spo2Entries!, graphBpmLine4);
if (interpretations != null && highlight) {
drawInterpretationAreas(
canvas, interpretations?.accelerationsList, graphSafeZone);
drawInterpretationAreas(
canvas, interpretations?.decelerationsList, graphUnSafeZone);
drawInterpretationAreas(
canvas, interpretations?.noiseList, graphNoiseZone);
}
// canvas.drawLine(
// Offset(xOrigin + 20,
// yOrigin - pixelsPerOneCM ),
// Offset(xOrigin + 20,
// yOrigin - pixelsPerOneMM * 3),
// graphOutlines);
}