Class: BaseTwoPoint

CIQ.Drawing. BaseTwoPoint

new BaseTwoPoint()

Base class for drawings that require two mouse clicks. Override as required.



Returns the highlighted state. Set this.highlighted to the highlight state. For simple drawings the highlighted state is just true or false. For complex drawings with pivot points for instance, the highlighted state may have more than two states. Whenever the highlighted state changes a draw() event will be triggered.

Name Type Description
highlighted Boolean

True to highlight the drawing, false to unhighlight

CIQ.Drawing#setPoint(point, x, y [, chart])

Sets the internal properties of the drawing points where x is a tick or a date and y is a value.

Name Type Argument Description
point number

index to point to be converted (0,1)

x number | string

index of bar in dataSet (tick) or date of tick (string form)

y number


chart CIQ.Chart <optional>

Optional chart object

  • 04-2015


Any two-point drawing that results in a drawing that is less than 10 pixels can safely be assumed to be an accidental click. Such drawings are so small that they are difficult to highlight and delete, so we won't allow them.

Note: it is very important to use pixelFromValueAdjusted() rather than pixelFromPrice(). This will ensure that saved drawings always render correctly when a chart is adjusted or transformed for display


Default adjust function for BaseTwoPoint drawings


Determine whether the tick/value lie within the theoretical box outlined by this drawing's two points


Value will be the actual underlying, unadjusted value for the drawing. Any adjustments or transformations are reversed out by the kernel. Internally, drawings should store their raw data (date and value) so that they can be rendered on charts with different layouts, axis, etc


Intersection is based on a hypothetical box that follows a user's mouse or finger around An intersection occurs when either the box crosses over the drawing.The type should be "segment", "ray" or "line" depending on whether the drawing extends infinitely in any or both directions. radius determines the size of the box in pixels and is determined by the kernel depending on the user interface (mouse, touch, etc)


Default measure function for BaseTwoPoint drawings


Default move function for BaseTwoPoint drawings