#include "Frequency_Axis.h" #include "Axis_Format.h" #include namespace renderive::detail { Frequency_Axis_Control::Frequency_Axis_Control(::Scene_Base& scene, const Axis_Properties& properties) : Axis(scene, properties) {} std::string Frequency_Axis_Control::format_tick_label(double tick, const Axis_Properties& state) const { const double absolute = std::abs(tick); if (absolute >= 1'000'000.0) return localized_axis_number(tick / 1'000'000.0, state.precision.get(), state.locale) + " MHz"; if (absolute >= 1'000.0) return localized_axis_number(tick / 1'000.0, state.precision.get(), state.locale) + " kHz"; return localized_axis_number(tick, state.precision.get(), state.locale) + " Hz"; } } // namespace renderive::detail