Expand description
Rendering and geometry helpers for chart composition.
Use coords for coordinate conversions, series for hit testing and series
settings, overlays for order flow visualizations and primitives for custom
rendering. For a chart that manages data, layout and interaction, use
Chart.
Internal painting lives in one rendering tree, grouped into axes, chart
types, overlays and supporting chart elements. Interaction state belongs to
the widget.
Modules§
- coords
- Coordinate mapping between bar indices, prices and screen positions.
- overlays
- Order flow visualizations for the price pane.
- primitives
- Custom drawing attached to a series: primitives, and the renderers of custom series.
- series
- Series hit testing, selection state, selection dot rendering and per-series display settings.
Structs§
- Render
Context - Core rendering context containing painter and drawing area
- Trading
Line Options - What
render_trading_linesdraws and offers. - Trading
Lines - What
render_trading_linesdrew, and what the user asked for.
Enums§
- PnlUnit
- What a profit or loss on the trading lines is written in.
- Trading
Label Alignment - Horizontal placement of trading line labels inside the price pane.
- Trading
Line Action - What the user asked for on a trading line. Confirm it with the user, then send it to the broker.
Functions§
- alert_
shortcut_ price - Resolve Alt+A at a hovered chart price without handling keys owned by a field or popup. The host decides whether to open a dialog or save a default alert at the returned price.
- axis_
settings_ button - A 24-point scale-settings target in the price/time-axis corner. The caller opens its existing scale menu when the returned response is clicked, before handling scale drags.
- crosshair_
price_ action - Paints a 26 by 20 point circled-plus button joined to the left of
tag. A click returnspricefor the host’s alert, order or price-line menu. The tag itself remains available for price-axis drags. Uses the theme’s tag fill andforegroundink; call before handling price-axis drags. - price_
axis_ width - Width of the current price labels and tags, including their plot gap and right clearance.
Include formatted session and volume labels in
tag_labelswhen allocating their column, and the hostformatterthe labels are written with. - render_
alert_ levels - Draw price thresholds and return a replacement alert after a drag.
Supply only alerts for this pane, resolving symbol or watchlist membership in the host.
With
active_onlyunset, triggered, disabled and expired alerts are drawn dimmed. Call after drawing the chart, then submit the result through the host’s alerts service. Non-price sources require the host to resolve their own pane and coordinates.formatsupplies the instrument’s precision and currency for labels. - render_
axis_ currency - Paints a currency button at the top of an axis column and returns its response and
the host currency choice, if any. The host supplies available conversions and replaces
the prices and instrument metadata after a choice; the renderer never converts prices.
unitappends the host’s price unit without converting prices. An empty currency shows only the unit and offers no conversion menu. Pass the response rectangle to price tick occlusion. - render_
crosshair_ full - Renders crosshair with full customization: style, mode, color, line width, line style
- render_
event_ band - Draws host-supplied event badges just above
baseline, using the chart’s time mapping. An event between bars uses the first bar at or after its time; whitespace extrapolates the most common positive spacing among the outermost 16 bars. Colliding badges stack upward. Returns the clicked event ID; callers handle that action before starting a chart drag. The badges use the event’s colour, text and tooltip, without assigning any market meaning to them. - render_
quote_ tags - Paints independent current close, session and volume readouts, returning their rectangles in that order. Pass all three rectangles to tick occlusion and pointer routing.
- render_
trading_ lines - Draws the working orders with their brackets and the open positions of one symbol on the
chart, and returns what the user asked for. Pass only the orders and positions of the
chart’s symbol, and call it after drawing the chart. The price axis is left to the caller; see
TradingLines::tags.