Class: Marker

Marker (params)

A Marker is a rendering on a chart that represents a specifc event, such as a news, corporate action, or signal. Markers are automatically created through the loading of events CompactChart#addEvents or through configuration of signals to studies.


new Marker(params)

Create a new Marker. You would only have to do this for a one-off marker not related to any event feed or signal.

Parameters:
Name Type Description
params MarkerParams

Parameters used to create the marker.

Since:
  • 9.4.0

Type Definitions


MarkerBox

Bounding dimensions of a marker or click zone for a marker when drawn on the chart.

Type:
  • object
Properties:
Name Type Argument Description
x0 number

Upper left corner of marker x-coord.

x1 number

Lower right corner of marker x-coord.

y0 number

Upper left corner of marker y-coord.

y1 number

Lower right corner of marker y-coord.

r number <optional>

Radius of click zone from center.

midX number <optional>

Center of marker x-coord.

midY number <optional>

Center of marker y-coord.

stemHeight number <optional>

Height of stem when present.

Since:
  • 9.4.0


MarkerConfig

Configuration settings for a marker.

Type:
  • object
Properties:
Name Type Argument Description
drawDelay number <optional>

Time to wait in msec for drawing markers.

Since:
  • 9.4.0


MarkerParams

Parameters used to create and display a marker on the chart.

Type:
  • object
Properties:
Name Type Argument Default Description
qc CompactChart

CompactChart instance.

x Date | number

Position of marker on the x axis. Value depends on xPositioner value.

y number <optional>

Position of marker on the y axis. Value depends on yPositioner value, and isn't required in all cases.

xPositioner XPositioner

Positioning type for x axis.

yPositioner YPositioner <optional>
'value'|'above_candle'

Positioning type for y axis. Default is set to 'value' if y is provided as a number, otherwise default is set to 'above_candle'.

includeAxis boolean <optional>

If true, positioning and placement will be relative to the panel area including the y axes. Otherwise, the area does not include the axes.

label string

Group type of marker. Usually markers for the same security from the same source get the same label.

offset number <optional>

Pixels to offset the marker vertically from its computed position.

panelName string <optional>

Name of panel the marker is to be rendered upon.

symbol string <optional>

Symbol identifier, used when marker is placed relative to a plot, such as when yPositioner='above_candle', for example.

field string <optional>

Field identifier, used when marker is placed relative to a plot, such as when yPositioner='above_candle', for example.

avoidFlush boolean <optional>

When true, inserts a 5 pixel buffer between the marker and the border of the panel.

node HTMLElement <optional>

The DOM element controlled by this marker.

className string <optional>

Category of marker.

id string <optional>

Unique id for marker.

nodeCreator MarkerNode <optional>

Class representing the expansion of the marker (what happens when marker is clicked, for example).

chartContainer HTMLElement <optional>

If provided, marker will be inserted as a child of this element.

yAxis YAxis <optional>

If provided, marker will be positioned relative to that axis's value.

future boolean <optional>

If true, indicates marker will be positioned "in the future", to the right of the most recent tick.

translate boolean | function

If true, will apply standard language translation to marker comments. If a function, will utilize that function when translation is needed. The this argument of the function is this MarkerParams object.

box MarkerBox <optional>

Represents the bounding dimensions of the marker when drawn on the chart.

Since:
  • 9.4.0


XPositioner

Possible values of the marker's xPositioner property.

Type:
  • 'master' | 'tick' | 'date' | 'none'
Since:
  • 9.4.0


YPositioner

Possible values of the marker's yPositioner property.

Type:
  • 'above_candle' | 'below_candle' | 'on_candle' | 'value' | 'top' | 'bottom' | 'top_lane' | 'bottom_lane' | 'none'
Since:
  • 9.4.0