pub trait PriceFormatter: Send + Sync {
// Required methods
fn format(&self, price: f64) -> String;
fn clone_box(&self) -> Box<dyn PriceFormatter>;
// Provided method
fn format_tick(&self, price: f64) -> String { ... }
}Expand description
Trait for custom price formatting on the Y axis.
Implement this trait to control how numeric prices are displayed as labels.
All formatters must be Send + Sync so they can be shared across the
render pipeline.
Required Methods§
Sourcefn clone_box(&self) -> Box<dyn PriceFormatter>
fn clone_box(&self) -> Box<dyn PriceFormatter>
Clone this formatter into a Box
Provided Methods§
Sourcefn format_tick(&self, price: f64) -> String
fn format_tick(&self, price: f64) -> String
Format a price axis tick. Defaults to format; override it
to write ticks differently from crosshair and price tag labels.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".