Skip to main content

render_book_profile

Function render_book_profile 

Source
pub fn render_book_profile(
    painter: &Painter,
    mapping: &ChartMapping,
    book: Option<&OrderBook>,
    queue: Option<&OrderQueue>,
    tick: f64,
    view: &OrderBookView,
    colors: [Color32; 2],
) -> Result<(), OrderFilterUnavailable>
Expand description

Draws the profile of queue’s orders, or of book when the feed sends aggregate depth only, as bars growing left from the right edge of mapping.rect, longest 60 points, tick high at each price, centred on it. Bids use colors[0] and asks colors[1], unless the largest order at the price reaches a tier of the view, drawn in OrderBookView::tier_color with the painter’s active theme. Fails, drawing nothing, when the view needs individual orders and the feed has none, so that the host can say the filtering is unavailable. A key identifies the measure, quantity unit and maximum across all supplied levels, including offscreen ones, after filtering. Hovering a row anywhere in the 60-point strip shows its exact price, side and measured resting size, without abbreviating quantities.