Class Plots
Utility class used for drawing markers.
Properties
Collection of hotspots to be re-used on a series redraw.
Collection of hotspots to be used in the series.
Collection of markers to be re-used on a series redraw.
_markers
- private object
Collection of markers to be used in the series.
Methods
private
void
_clearHotspotCache
(
)
Removes unused hotspots from the hotspot cache
private
void
_clearMarkerCache
(
)
Removes unused markers from the marker cache
private
_createHotspot
(
styles
,
order
,
index
)
Creates a shape to be used as a hotspot.
- Parameters:
-
styles
<Object>
Hash of style properties.
-
order
<Number>
Order of the series.
-
index
<Number>
Index within the series associated with the hotspot.
- Returns:
- Shape
private
void
_createHotspotCache
(
)
Creates a cache of hotspots for reuse.
private
_createMarker
(
styles
,
order
,
index
)
Creates a shape to be used as a marker.
- Parameters:
-
styles
<Object>
Hash of style properties.
-
order
<Number>
Order of the series.
-
index
<Number>
Index within the series associated with the marker.
- Returns:
- Shape
private
void
_createMarkerCache
(
)
Creates a cache of markers for reuse.
protected
_getItemColor
(
val
,
i
)
Parses a color from an array.
- Parameters:
-
val
<Array>
collection of colors
-
i
<Number>
index of the item
- Returns:
- String
protected
_getPlotDefaults
(
)
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.
protected
_getState
(
type
)
Returns marker state based on event type
- Parameters:
-
type
<String>
event type
- Returns:
- String
private
void
_parseMarkerStyles
(
)
Combines new styles with existing styles.
protected
_setStyles
(
newStyles
)
Method used by styles
setter. Overrides base implementation.
- Parameters:
-
newStyles
<Object>
Hash of properties to update.
- Returns:
- Object
protected
void
drawPlots
(
)
Draws the markers
protected
getHotspot
(
styles
,
order
,
index
)
Gets and styles a hotspot. If there is a hotspot in cache, it will use it. Otherwise
it will create one.
- Parameters:
-
styles
<Object>
Hash of style properties.
-
order
<Number>
Order of the series.
-
index
<Number>
Index within the series associated with the hotspot.
- Returns:
- Shape
protected
getMarker
(
styles
,
order
,
index
)
Gets and styles a marker. If there is a marker in cache, it will use it. Otherwise
it will create one.
- Parameters:
-
styles
<Object>
Hash of style properties.
-
order
<Number>
Order of the series.
-
index
<Number>
Index within the series associated with the marker.
- Returns:
- Shape
protected
void
updateMarkerState
(
type
,
i
)
Resizes and positions markers based on a mouse interaction.
- Parameters:
-
type
<String>
state of the marker
-
i
<Number>
index of the marker