Expand description
Price ranges, coordinate transforms, axis ticks and label formatting.
Use PriceScale and its per-frame PriceMap to map prices to screen
coordinates. PriceFormatter and TimeFormatter customize axis labels;
HorizontalScale supports non-time axes such as strikes and maturities.
Structs§
- Currency
Formatter - Currency formatter with symbol.
- Custom
Price Formatter - Custom price formatter using a closure
- Custom
Time Formatter - Custom time formatter using a closure
- Default
Price Formatter - Default price formatter with configurable precision
- Default
Time Formatter - Default time formatter using standard formats
- Locale
Time Formatter - Locale-aware time formatter: month and weekday names and the AM/PM marker
in the locale’s language, laid out as
DefaultTimeFormatterdoes. - Maturity
Scale - A horizontal scale of maturities in months, for yield curves, encoded with
key_time. - Percentage
Formatter - Percentage price formatter
- Price
Formatter Builder - Builder for creating price formatters
- Price
Horizontal Scale - A horizontal scale of prices, such as the strikes of an option chain, encoded with
key_time. - Price
Map - Per-frame price-to-pixel mapping.
- Price
Mark - A single price tick mark on the Y axis
- Price
Mark Generator - Smart price axis mark generator Implements “nice numbers” algorithm for price ticks
- Price
Mark Generator Config - Configuration for price mark generation, set per scale through
PriceScaleOptions::tick_marks. - Price
Range - A min/max price range, used throughout the scale engine.
- Price
Scale - One price axis: options and the visible range in scale units, fitted to the data until the user scales it by hand.
- Price
Scale Margins - Space auto-scaling leaves above and below the data, as fractions of the pane height.
- Price
Scale Options - Configuration options for a
PriceScale. - Price
Transform - How one series’ prices become scale units.
- Relative
Time Formatter - Relative time formatter (e.g., “2h ago”, “yesterday”)
- Scientific
Formatter - Scientific notation formatter
- Tick
Mark - A single tick mark on the time axis
- Tick
Mark Context - Display time and chart locale for one time-axis tick.
- Tick
Mark Generator - Smart time axis mark generator Implements intelligent mark distribution algorithm
- Tick
Mark Generator Config - Configuration for tick mark generation
- Tick
Mark Layout - Where the tick marks of a horizontal axis are laid out.
- Tick
Mark Weight - Weight of a tick mark (0-100 scale) Higher weight = more important mark = displayed at lower zoom levels
- Time
Formatter Builder - Builder for creating time formatters
- Volume
Formatter - Volume formatter (K, M, B suffixes)
Enums§
- Price
Scale Id - Identifies one of a pane’s price axes.
- Price
Scale Mode - Scaling mode for the price (Y) axis.
- Study
Format - Units used in study legends, axes, tooltips and data windows.
- Tick
Mark Type - Type of tick mark on the time scale
- Timezone
Mode - Timezone display mode for time axis labels.
Traits§
- Horizontal
Scale - What the keys of the horizontal axis mean: which of them are labelled, how, and how the crosshair label reads.
- Price
Formatter - Trait for custom price formatting on the Y axis.
- Time
Formatter - Trait for custom time formatting Allows users to customize how time labels are displayed on the axis
Functions§
- bar_
countdown - Formats the time left in an open bar, using an exact host or session close when supplied.
Without an exact close, calendar months end at the next month’s first day and intraday
bars end no later than UTC midnight, as in
BarClock. Closed or future bars have no label. - instrument_
price_ precision - Instrument decimals, falling back to the decimal places needed to write its minimum tick. Invalid tick sizes are ignored; explicit decimals take precedence.
- key_
time - The bar time standing for a numeric key on a horizontal scale other than time: the key as seconds from the Unix epoch, to the nanosecond, so times sort as their keys do.
- time_
key - The numeric key a bar time stands for, the inverse of
key_time.