feat(plot): nice-number ticks, axes, grid, traces, cursors, measurement queries
This commit is contained in:
1 parent
b4e88fe0c1
commit
93fc06f050
18 files changed
+1582
No files matched your search
@@ -0,0 +1,18 @@
|
||||
#include <plot/plot/axis.hpp>
|
||||
|
||||
namespace plot {
|
||||
|
||||
void Axis::refresh(f32 px, f32 min_px, bool include_minors) {
|
||||
generate_ticks(range, px, min_px, ticks, include_minors);
|
||||
if (format != TickFormat::Time) return;
|
||||
// generate_ticks labels with format_si; a time axis relabels its majors here,
|
||||
// because the tick generator has no business knowing about a clock.
|
||||
char buf[64];
|
||||
for (Tick& tick : ticks) {
|
||||
if (!tick.major) continue;
|
||||
format_time(tick.value, buf, sizeof buf);
|
||||
tick.label = buf;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace plot
|
||||
Reference in new issue
Block a user