drawSAR method
void
drawSAR(
- CandleEntity lastPoint,
- CandleEntity curPoint,
- Canvas canvas,
- double lastX,
- double curX,
Implementation
void drawSAR(CandleEntity lastPoint, CandleEntity curPoint, Canvas canvas,
double lastX, double curX) {
final sar = curPoint.sar;
if (sar == null) return;
final halfHL = (curPoint.high + curPoint.low) / 2;
late final color;
if (sar == halfHL) {
color = this.chartColors.avgColor;
} else if (sar < halfHL) {
color = this.chartColors.upColor;
} else {
color = this.chartColors.dnColor;
}
drawCircle(canvas, curX, sar, color);
}