Skip to main content

Common drawing tool properties

Each drawing tool has its own set of properties and methods regarding its behavior and visual appearance. All of these properties can be modified both via user interface and in code. See Modifying drawing tools to learn how.

However, there are many common properties that most drawing tools have. This section introduces these properties and methods to use them.


Area color
Some drawing tools have colored areas for example between its lines. Area color, setAreaColor() method in code, adjusts the color of these areas. Note that LightningChart often automatically applies some transparency to the colored area to prevent the tools from completely covering the price data underneath them.

Fill enabled
Some drawing tools with colored areas have option to switch off the coloring. If Fill enabled, setFillEnabled() in code, is set false, the colored areas become transparent, and only the drawing tool lines are shown.

Line color
Line color adjusts the color of the drawing tool line. In code, setLineColor() method can be used for this. If the drawing tool contains several lines, the same method modifies all the lines. Line color also affects the control points.

Line width
Line width adjusts the width of the indicator line. In code, setLineWidth() method can be used for this. If the drawing tool contains several lines, the same method modifies all the lines. Line width also affects the control points.

Magnetic
Enabling Magnetic causes the drawing tool to automatically snap to the closest OLHC-data point in vertical direction. For example, the end points of a Trend Line are based on the Close values at the positions of the respective control points. Use setMagnetic() method in code to enable and disable this.