Table of Contents

Class HistogramRender

Namespace
OFT.Rendering.Helpers
Assembly
OFT.Rendering.dll

Draws a horizontal histogram, one bar per price row (the DOM indicator draws the order book with it). Rows added with AddPrice(int, int, int, int) in their order along the price axis are merged into polygons: adjacent rows of the same length share one outline, so a thousand rows do not become a thousand rectangles. Draw(RenderContext, Color, bool, bool) paints the result; Clear() starts the next frame.

public class HistogramRender
Inheritance
object
HistogramRender
Extension Methods

Constructors

HistogramRender(bool)

Creates a histogram whose bars grow from the zero line to the right (leftToRight true) or to the left.

public HistogramRender(bool leftToRight)

Parameters

leftToRight bool

HistogramRender(bool, bool)

Creates a histogram whose bars grow from the zero line to the right (leftToRight true) or to the left, with the initial Transparent value.

public HistogramRender(bool leftToRight, bool transparent)

Parameters

leftToRight bool
transparent bool

Properties

DirectMode

When true, every pixel row is kept on its own with the longest bar added for it and painted as a filled rectangle, without merging rows into polygons. Fits price rows thinner than a pixel; set it before the first AddPrice(int, int, int, int).

Added in ATAS 8.0.15.

public bool DirectMode { get; set; }

Property Value

bool

Transparent

When true, AddPrice(int, int, int, int) keeps nothing and Draw(RenderContext, Color, bool, bool) paints nothing.

public bool Transparent { get; set; }

Property Value

bool

Methods

AddPrice(int, int, int, int)

Adds the bar of one price row: from the zero line at zeroX to x, between upperY and bottomY (screen coordinates, upperY is the smaller one). Add the rows in their order along the price axis, so that adjacent rows merge. A row with x equal to zeroX (no value) is skipped, as is every row while Transparent is set.

public void AddPrice(int zeroX, int x, int bottomY, int upperY)

Parameters

zeroX int
x int
bottomY int
upperY int

Clear()

Drops the rows added so far; the buffers are kept for the next frame.

Added in ATAS 8.0.15.

public void Clear()

Draw(RenderContext, Color, bool)

Paints the rows added since Clear(), the zero line included (Draw(RenderContext, Color, bool, bool) with drawZeroValues true).

public void Draw(RenderContext context, Color fillingBrush, bool fill)

Parameters

context RenderContext
fillingBrush Color
fill bool

Draw(RenderContext, Color, bool, bool)

Paints the rows added since Clear(): the outline of every merged polygon in fillingBrush, and its inside too when fill is true. With drawZeroValues false the outline is cut where it returns to the zero line, so rows without a value get no line along the zero line. Nothing is painted for a fully transparent color.

Added in ATAS 8.0.15.

public void Draw(RenderContext context, Color fillingBrush, bool fill, bool drawZeroValues)

Parameters

context RenderContext
fillingBrush Color
fill bool
drawZeroValues bool