DrawingObjectLine
public DrawingObjectLine(DrawingObjectBase parent)Creates a new DrawingObjectLine associated with the DrawingObjectBase instance specified in parent. The line is initially visible.
API documentation, members, signatures, and C# examples.
Find classes, members, and documentation.
Represents a component line in a chart drawing object. A DrawingObjectLine is defined by two Handle instances and provides properties that control its appearance, visibility, extension, and interaction behavior.
public DrawingObjectLine(DrawingObjectBase parent)Creates a new DrawingObjectLine associated with the DrawingObjectBase instance specified in parent. The line is initially visible.
public bool CanChangeExtendLeftControls whether the ExtendLeft property of this line is changed when the user changes the "Extend Left" Parameter of the Parent drawing object. The default value is true.
public bool CanChangeExtendRightControls whether the ExtendRight property of this line is changed when the user changes the "Extend Right" Parameter of the Parent drawing object. The default value is true.
public bool CanChangeLineStyleControls whether the LineStyle property of this line is changed when the user changes the "Line Style" Parameter of the Parent drawing object. The default value is true.
public WLColor ColorSpecifies an optional color for the line. The default value is WLColor.Empty. Drawing objects can use this property to allow individual component lines to be rendered in a different color than the parent drawing object.
public bool ExtendReturns true if either ExtendLeft or ExtendRight is true.
public bool ExtendLeftControls whether the line extends to the left beyond its LeftHandle when rendered.
public bool ExtendRightControls whether the line extends to the right beyond its RightHandle when rendered.
public void FixHandleOrder()Ensures that Handle1 occurs before Handle2 on the chart. If the Index of Handle1 is greater than the Index of Handle2, the DateTime and Value properties of the two handles are swapped.
public Handle Handle1One of the two Handle instances that define the line.
public Handle Handle2One of the two Handle instances that define the line.
public bool InViewport(int startX, int endX)public bool InViewport(int x)Determines whether the line is visible within a specified range of chart bar indices, taking the ExtendLeft and ExtendRight settings into account. The first version returns true if the line, or an extended portion of it, intersects the range from startX through endX. The second version determines whether the line extends through the single bar index specified in x.
public bool IsDraggableControls whether the user can drag the line with the mouse.
public bool IsMouseOver(Point pt)Returns true if the mouse position specified in pt is considered to be over the line. The method returns false if IsDraggable is false. For non-vertical lines, a mouse position within approximately 5 pixels of the line is considered to be over it.
public bool IsVerticalReturns true if Handle1 and Handle2 have the same DateTime.
public bool IsVisibleControls whether the line should be rendered. A newly constructed DrawingObjectLine is visible by default.
public Handle LeftHandleReturns the Handle that occurs on the left side of the line, based on the handles' Index values. If both handles have the same Index, Handle1 is returned.
public LineStyle LineStyleSpecifies the LineStyle used when rendering the line. The default value is LineStyle.Solid.
public int LineWidthSpecifies the width of the line. The default value is 2.
public DrawingObjectBase ParentReturns the DrawingObjectBase instance that this line belongs to.
public void Parse(string s)Restores the state of the DrawingObjectLine from the persisted string specified in s. The persisted handle references are resolved against the Handles collection of the Parent drawing object.
public string Persist()Returns a string containing the persisted state of the DrawingObjectLine, including its handles, drag state, line style, extension settings, visibility, color, and line width.
public void Render(DrawingContext dc, Pen pen)Renders the line to the specified DrawingContext (dc) using the specified pen. If ExtendLeft or ExtendRight is enabled, the line is extended toward the corresponding edge of the chart. The line is not rendered if IsVisible is false.
public Handle RightHandleReturns the Handle that occurs on the right side of the line, based on the handles' Index values. If both handles have the same Index, Handle2 is returned.
public double SolveForY(DateTime dt)Returns the y-axis value at which the line intersects the DateTime specified in dt. Returns Double.NaN if the required chart coordinate conversion cannot be performed. For a vertical line, the method returns the Value of Handle1.
public double StreamingValueReturns the projected y-axis value of the line at the next streaming bar position. This is calculated by extending the slope defined by Handle1 and Handle2 one bar beyond the chart's current EndIndex. Returns Double.NaN if the value cannot be calculated.
Ask the community or explore custom development services.