mirror of
https://github.com/Genaker/LoraSA.git
synced 2026-08-08 18:03:08 +02:00
Visualize scan_max_result better - add frequency labels
This commit is contained in:
@@ -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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user