NinjaScript > Language Reference > Drawing >

DrawHorizontalLine()

Print this Topic Previous pageReturn to chapter overviewNext page

Definition
Draws a horizontal line.

 

Method Return Value

An IHorizontalLine object that represents the draw object.

 

Syntax

DrawHorizontalLine(string tag, double y, Color color)
DrawHorizontalLine(string tag, bool autoScale, double y, Color color, DashStyle dashStyle, int width)
 

Parameters

tag

A user defined unique id used to reference the draw object. For example, if you pass in a value of "myTag", each time this tag is used, the same draw object is modified. If unique tags are used each time, a new draw object will be created each time.

autoScale

Determines if the draw object will be included in the y-axis scale. Default value is false.

y

The y value

color

The draw object color (reference)

dashStyle

DashStyle.Dash
DashStyle.DashDot
DashStyle.DashDotDot
DashStyle.Dot
DashStyle.Solid
(reference)

 

Note: Fancier DashStyles like DashDotDot will require more resources than simple DashStyles like Solid.

width

The width of the draw object

 

 

Examples

// Draws a horizontal line
DrawHorizontalLine("tag1", 1000, Color.Black);