Show:
Module: series-plot-util
Parent Module: charts

Utility class used for drawing markers.

Constructor

Plots

()

Methods

_clearMarkerCache

() private

Removes unused markers from the marker cache

_createGroupMarkers

(
  • styles
)
protected

Draws a series of markers in a single shape instance.

Parameters:

  • styles Object

    <p><p><p><p><p><p>Set of configuration properties used to create the markers.</p></p></p></p></p></p>

_createMarker

(
  • styles
)
private

Creates a shape to be used as a marker.

Parameters:

  • styles Object

    <p><p><p><p><p><p>Hash of style properties.</p></p></p></p></p></p>

Returns:

<p><p><p><p><p><p>Shape</p></p></p></p></p></p>

_createMarkerCache

() private

Creates a cache of markers for reuse.

_getDefaultStyles

() protected

Returns:

<p><p><p><p><p><p>Object</p></p></p></p></p></p>

_getGroupShape

(
  • shape
)
protected

Returns the correct group shape class.

Parameters:

  • shape Shape | String

    <p><p><p><p><p><p>Indicates which shape class.</p></p></p></p></p></p>

Returns:

<p><p><p><p><p><p>Function</p></p></p></p></p></p>

_getItemColor

(
  • val
  • i
)
protected

Parses a color from an array.

Parameters:

  • val Array

    <p><p><p><p><p><p>collection of colors</p></p></p></p></p></p>

  • i Number

    <p><p><p><p><p><p>index of the item</p></p></p></p></p></p>

Returns:

<p><p><p><p><p><p>String</p></p></p></p></p></p>

_getPlotDefaults

() protected

Gets the default values for series that use the utility. This method is used by the class' styles attribute's getter to get build default values.

Returns:

<p><p><p><p><p><p>Object</p></p></p></p></p></p>

_getState

(
  • type
)
protected

Returns marker state based on event type

Parameters:

  • type String

    <p><p><p><p><p><p>event type</p></p></p></p></p></p>

Returns:

<p><p><p><p><p><p>String</p></p></p></p></p></p>

_parseMarkerStyles

(
  • Object
)
private

Combines new styles with existing styles.

Parameters:

  • Object Object

    <p><p><p><p><p><p>containing style properties for the marker.</p></p></p></p></p></p>

Returns:

<p><p><p><p><p><p>Object</p></p></p></p></p></p>

_setStyles

(
  • newStyles
)
protected

Method used by styles setter. Overrides base implementation.

Parameters:

  • newStyles Object

    <p><p><p><p><p><p>Hash of properties to update.</p></p></p></p></p></p>

Returns:

<p><p><p><p><p><p>Object</p></p></p></p></p></p>

_toggleVisible

(
  • visible
)
private

Toggles visibility

Parameters:

  • visible Boolean

    <p><p><p><p><p><p>indicates visibilitye</p></p></p></p></p></p>

drawPlots

() protected

Draws the markers

drawSeries

() protected

getMarker

(
  • styles
  • order
  • index
)
protected

Gets and styles a marker. If there is a marker in cache, it will use it. Otherwise it will create one.

Parameters:

  • styles Object

    <p><p><p><p><p><p>Hash of style properties.</p></p></p></p></p></p>

  • order Number

    <p><p><p><p><p><p>Order of the series.</p></p></p></p></p></p>

  • index Number

    <p><p><p><p><p><p>Index within the series associated with the marker.</p></p></p></p></p></p>

Returns:

<p><p><p><p><p><p>Shape</p></p></p></p></p></p>

updateMarkerState

(
  • type
  • i
)
protected

Resizes and positions markers based on a mouse interaction.

Parameters:

  • type String

    <p><p><p><p><p><p>state of the marker</p></p></p></p></p></p>

  • i Number

    <p><p><p><p><p><p>index of the marker</p></p></p></p></p></p>

Properties

_groupShapes

Unknown private

Pre-defined group shapes.

_markerCache

Array private

Collection of markers to be re-used on a series redraw.

_markers

Array private

Collection of markers to be used in the series.

_plotDefaults

Object private

Storage for default marker styles.

_statSyles

Object private