Class: Drawing

StockChartX. Drawing


<abstract> new Drawing(config)

Represents abstract chart drawing.
Parameters:
Name Type Argument Description
config object <optional>
The configuration object.
Properties
Name Type Argument Description
points StockChartX.Point | Array.<StockChartX.Point> | StockChartX.ChartPoint | Array.<StockChartX.ChartPoint> <optional>
The point(s).
point StockChartX.Point | StockChartX.ChartPoint <optional>
The point.
visible boolean <optional>
The flag that indicates whether drawing is visible.
selectable boolean <optional>
The flag that indicates whether drawing can be selected.
locked boolean <optional>
The flag that indicates whether drawing is locked.
resizable boolean <optional>
The flag that indicates whether drawing is resizable.
theme object <optional>
The theme.

Members


<static> registeredDrawings. :Object

Gets object with information about registered drawings. Key is class name and value is drawing's constructor.
Type:
  • Object

actualTheme :object

Returns actual theme.
Type:
  • object

<readonly> canMove :boolean

Returns true if drawing can be moved, false otherwise.
Type:
  • boolean

<readonly> canResize :boolean

Returns true if drawing can be resized, false otherwise.
Type:
  • boolean

<readonly> canSelect :boolean

Returns true if drawing can be selected, false otherwise.
Type:
  • boolean

chartPoints :Array.<StockChartX.ChartPoint>

Gets/Sets array of chart points.
Type:

locked :boolean

Gets/Sets flag that indicates whether drawing is locked.
Type:
  • boolean

<readonly> pointsNeeded :number

Returns number of required points for the drawing.
Type:
  • number

resizable :boolean

Gets/Sets flag that indicates whether drawing is resizable.
Type:
  • boolean

selectable :boolean

Gets/Sets flag that indicates whether drawing is selectable.
Type:
  • boolean

selected :boolean

Gets/Sets flag that indicates whether drawing is selected.
Type:
  • boolean

theme :object

Gets/Sets theme.
Type:
  • object

Methods


<static> deserialize(state)

Deserializes drawing.
Parameters:
Name Type Description
state string | Object The drawing's state.
Returns:
Type
StockChartX.Drawing

<static> register(type)

Registers new drawing.
Parameters:
Name Type Description
type function The constructor.

appendChartPoint(point)

Appends new chart point.
Parameters:
Name Type Description
point StockChartX.Point | StockChartX.ChartPoint The point to append.
Returns:
The array of drawing's points.
Type
Array.<StockChartX.ChartPoint>
Example
var drawing = new StockChartX.DotDrawing();
 drawing.appendChartPoint({record: 10, value: 20.0});

bounds()

Returns bounds rectangle.
Returns:
Type
StockChartX.Rect

cartesianPoint(index)

Converts chart point to cartesian point.
Parameters:
Name Type Description
index number The index of point.
Returns:
Type
StockChartX.Point
Example
var point = drawing.getCartesianPoint(0);
 var x = point.x;
 var y = point.y;

cartesianPoints()

Converts all chart points to cartesian points.
Returns:
Type
Array.<StockChartX.Point>

select()

Makes drawing selected.

translate(dx, dy)

Translates drawing onto a given distance.
Parameters:
Name Type Description
dx number The X offset.
dy number The Y offset.
Example
drawing.translate(5, 5);