Visualize scan_max_result better - add frequency labels

This commit is contained in:
Sassa NF
2025-01-05 18:47:27 +00:00
parent ed976d1b38
commit 810f9031d5
4 changed files with 174 additions and 1 deletions
+16
View File
@@ -200,5 +200,21 @@ void DecoratedBarChart::draw()
int tick_pos = bar.x2pos(bar.min_x + step * MINOR_TICKS);
display.drawVerticalLine(pos_x + tick_pos, y, MINOR_TICK_LENGTH);
}
if (draw_labels)
{ // TODO: adjust chart size; for now we'll just assume that we are not ruining
// display
display.setColor(BLACK);
display.fillRect(pos_x, y + MAJOR_TICK_LENGTH, width,
display.getStringWidth("00000"));
display.setColor(WHITE);
for (float step = 1; bar.min_x + step * MAJOR_TICKS < bar.max_x; step += 1)
{
int tick_pos = bar.x2pos(bar.min_x + step * MAJOR_TICKS);
drawVerticalString(display, ArialMT_Plain_10_Vert, pos_x + tick_pos - 5,
y + MAJOR_TICK_LENGTH,
String((int)(bar.min_x + step * MAJOR_TICKS)));
}
}
}
}