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
, andshowPriceLines
parameters. - 8.0.0 Added the
alwaysZoom
andeventZoomPeriodicity
parameters.
Methods
-
doubleClick(params)
-
Toggles the event zoom of a time span event marker.
Parameters:
Name Type Description params
object Configuration parameters.
Properties
Name Type Description x
number The clientX value of the
doubleClick
event.y
number The clientY value of the
doubleClick
event.panel
CIQ.ChartEngine.Panel The panel in which the
doubleClick
event 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 params
Object Necessary information to draw.
Properties
Name Type Description pixelLeft
number X-coordinate of the start date.
pixelRight
number X-coordinate of the end date.
startDate
Date Start date of the time span event, used for the x-axis label.
endDate
Date End date of the time span event, used for the x-axis label.
color
string Color value to fill/stroke the time span event shape.
firstPrice
number The first price in the event data. Setting this value causes a price line to be drawn if
showPriceLines
is set to true.lastPrice
number The last price in the event data. Setting this value causes a price line to be drawn if
showPriceLines
is set to true.showPriceLines
string A boolean that determines whether to draw price lines on the main chart.
- Since:
-
- 7.2.0
- 7.3.0 Added
firstPrice
,lastPrice
, andshowPriceLines
parameters.
-
drawSelected(params)
-
Draws the highlights when hovering or activating a time span event.
Parameters:
Name Type Description params
Object Necessary information to draw.
Properties
Name Type Description pixelLeft
number X-coordinate of the start date.
pixelRight
number X-coordinate of the end date.
yPixel
number Y-coordinate at which the time span event is located.
color
string 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 spanEvent
object 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 spanEvent
object 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 spanEvent
object 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 parameter
object Contains the function parameters.
Properties
Name Type Description chartLeftPX
number The leftmost pixel of the chart.
panel
CIQ.ChartEngine.Panel Panel in which the tooltip is located.
yPixel
number 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
dtLeft
anddtRight
values, 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
eventZoomPeriodicity
property (see CIQ.Marker.TimeSpanEvent) - The periodicity argument of this function
- The default periodicity calculations of CIQ.ChartEngine#setRange
Parameters:
Name Type Argument Description active
boolean Toggles the event zoom on or off.
periodicity
CIQ.ChartEngine~PeriodicityParameters <optional>
Sets the periodicity of the zoomed date range if the marker does not provide a value in its
eventZoomPeriodicity
property.- Since:
-
8.0.0
- Periodicity supplied by the event marker's
-
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 dataSegment
Object The
stx.chart.dataSegment
.startDate
Date When the span event actually begins.
endDate
Date 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
-
placementFunction(params)
-
Determines the placement of time span events.
Parameters:
Name Type Description params
Object Parameters passed from the Marker render function.
Properties
Name Type Description stx
CIQ.ChartEngine A reference to the chart engine.
panel
Object The panel where the marker is being placed.
- Since:
-
7.2.0
-
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 ctx
external:CanvasRenderingContext2D The canvas context.
string
string The string that needs to be truncated.
maxWidth
number The width that the string needs to fit into.
- Since:
-
7.2.0
Returns:
The truncated string.
- Type
- string
-
click(params)
-
Called when a time span event marker is selected.
Parameters:
Name Type Description params
object Configuration parameters.
Properties
Name Type Description cx
number The x-axis coordinate of the selection event.
cy
number The y-axis coordinate of the selection event.
panel
object The panel where the marker was selected.
- Since:
-
- 7.2.0
- 8.0.0 Signature changed to accept the
params
object.