new TimeSpanEvent(params)
Creates a time span event marker.
Note: Time span events are also known as life cycle events.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | Configuration parameters. Properties
|
- Since:
-
- 7.2.0
- 7.3.0 Added the
img,isActive, andshowPriceLinesparameters. - 8.0.0 Added the
alwaysZoomandeventZoomPeriodicityparameters.
Classes
Methods
-
click(params)
-
Called when a time span event marker is selected.
Parameters:
Name Type Description paramsobject Configuration parameters.
Properties
Name Type Description cxnumber The x-axis coordinate of the selection event.
cynumber The y-axis coordinate of the selection event.
panelobject The panel where the marker was selected.
- Since:
-
- 7.2.0
- 8.0.0 Signature changed to accept the
paramsobject.
-
doubleClick(params)
-
Toggles the event zoom of a time span event marker.
Parameters:
Name Type Description paramsobject Configuration parameters.
Properties
Name Type Description xnumber The clientX value of the
doubleClickevent.ynumber The clientY value of the
doubleClickevent.panelCIQ.ChartEngine.Panel The panel in which the
doubleClickevent occurred.- Since:
-
8.0.0
-
drawOnChart(params)
-
Draws the shaded area and x-axis labels when a time span event marker is activated.
Parameters:
Name Type Description paramsobject Necessary information to draw.
Properties
Name Type Description pixelLeftnumber X-coordinate of the start date.
pixelRightnumber X-coordinate of the end date.
startDateDate Start date of the time span event, used for the x-axis label.
endDateDate End date of the time span event, used for the x-axis label.
colorstring Color value to fill/stroke the time span event shape.
firstPricenumber The first price in the event data. Setting this value causes a price line to be drawn if
showPriceLinesis set to true.lastPricenumber The last price in the event data. Setting this value causes a price line to be drawn if
showPriceLinesis set to true.showPriceLinesstring A boolean that determines whether to draw price lines on the main chart.
- Since:
-
- 7.2.0
- 7.3.0 Added
firstPrice,lastPrice, andshowPriceLinesparameters.
-
drawSelected(params)
-
Draws the highlights when hovering or activating a time span event.
Parameters:
Name Type Description paramsobject Necessary information to draw.
Properties
Name Type Description pixelLeftnumber X-coordinate of the start date.
pixelRightnumber X-coordinate of the end date.
yPixelnumber Y-coordinate at which the time span event is located.
colorstring Color value to fill/stroke the time span event shape.
- Since:
-
7.2.0
-
drawSingleOrDurationEvent(spanEvent)
-
Draws a single or duration event in the time span events panel. Duration events have sub-event data.
Parameters:
Name Type Description spanEventobject The object that represents the time span event.
- Since:
-
7.2.0
-
drawSpanEvent(spanEvent)
-
Draws a span event in the time span events panel.
Parameters:
Name Type Description spanEventobject The object that represents the time span event.
- Since:
-
7.2.0
-
placeLabelOnYAxis(spanEvent)
-
Places a time span event label on the time span events panel y-axis.
Parameters:
Name Type Description spanEventobject The object that represents the time span event.
- Since:
-
7.2.0
-
positionTooltip(parameter)
-
Positions the marker's tooltip node in
panel.Parameters:
Name Type Description parameterobject Contains the function parameters.
Properties
Name Type Description chartLeftPXnumber The leftmost pixel of the chart.
panelCIQ.ChartEngine.Panel Panel in which the tooltip is located.
yPixelnumber The y-axis coordinate of the tooltip.
- Since:
-
8.0.0
-
toggleEventZoom(active [, periodicity])
-
Zooms and un-zooms the display of the time span event marker's date range.
The date range is based on the sub-children of the time span event. The first and last sub-children become the
dtLeftanddtRightvalues, respectively, in a call to CIQ.ChartEngine#setRange, which sets the date range of the chart.The periodicity of the zoomed date range is set by one of the following (in order of precedence):
- Periodicity supplied by the event marker's
eventZoomPeriodicityproperty (see CIQ.Marker.TimeSpanEvent) - The periodicity argument of this function
- The default periodicity calculations of CIQ.ChartEngine#setRange
Parameters:
Name Type Argument Description activeboolean Toggles the event zoom on or off.
periodicityCIQ.ChartEngine~PeriodicityParameters <optional>
Sets the periodicity of the zoomed date range if the marker does not provide a value in its
eventZoomPeriodicityproperty.- Since:
-
8.0.0
- Periodicity supplied by the event marker's
-
<static> createSpanDateObject(dataSegment, startDate, endDate)
-
Helper function to ensure the data is only drawn on the visible chart and whether an indicator is needed to show the event continues.
Parameters:
Name Type Description dataSegmentobject The
stx.chart.dataSegment.startDateDate When the span event actually begins.
endDateDate When the span event actually ends.
- Since:
-
7.2.0
Returns:
An object that contains the start and end dates to draw and a boolean to determine whether an indicator needs to be drawn on the span event.
- Type
- object
-
<static> placementFunction(params)
-
Determines the placement of time span events.
Parameters:
Name Type Description paramsobject Parameters passed from the Marker render function.
Properties
Name Type Description stxCIQ.ChartEngine A reference to the chart engine.
panelobject The panel where the marker is being placed.
- Since:
-
7.2.0
-
<static> truncateString(ctx, string, maxWidth)
-
Helper function to take a string that is too long and add an ellipsis on the end of the string.
Parameters:
Name Type Description ctxexternal:CanvasRenderingContext2D The canvas context.
stringstring The string that needs to be truncated.
maxWidthnumber The width that the string needs to fit into.
- Since:
-
7.2.0
Returns:
The truncated string.
- Type
- string
