new TimeSpanEventPanel(params)
The time span events panel that contains and displays all the time span events created by the user.
Note: Time span events are also known as life cycle events.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
object | Configuration parameters. Properties
|
- Since:
-
- 7.2.0
- 8.0.0 Added
params.customConstants
,params.cb
,params.infoPanel
,params.showTooltip
, andparams.alwaysZoom
. Added thealwaysZoom
property.
Example
var stxx=new CIQ.ChartEngine({container:document.querySelector(".chartContainer")});
// Instantiate the time span event panel.
new CIQ.TimeSpanEventPanel({
stx: stxx,
infoPanel: {
durationEvent: "main",
spanEvent: "panel",
singleEvent: null
},
customConstants: {
SPACING: 35,
RECT_HEIGHT: 25,
RADIUS_DEFAULT: 13,
RADIUS_HIGHLIGHT: 16,
MY_NEW_CONSTANT: 99
}
});
// To display the panel from a menu, use:
stxx.layout.timeSpanEventPanel = true // Show the panel.
stxx.changeOccurred("layout"); // Signal the change to force a redraw.
// To hide the panel from a menu, use:
stxx.layout.timeSpanEventPanel = false; // Hide the panel.
stxx.changeOccurred("layout"); // Signal the change to force a redraw.
Members
-
alwaysZoom :boolean
-
Enables event zoom on any time span event regardless of whether the event has sub-children.
Note: Individual event markers can set their own
alwaysZoom
property for more granular control (see CIQ.Marker.TimeSpanEvent). If a marker sets itsalwaysZoom
property to false, the marker's property takes precedence, and the marker zooms only if it has sub-children.Type:
- boolean
- Since:
-
8.0.0
- Default Value:
-
- true
Methods
-
calculatePanelHeight(lanes)
-
Helper function used to dynamically calculate the height of the time span events panel based on the number of swim lanes.
Parameters:
Name Type Description lanes
number The number of swim lanes to be rendered in the panel.
- Since:
-
8.0.0
Returns:
The panel height in pixels.
- Type
- number
-
calculateSpacingModifier(index)
-
Helper function used to calculate the
spacingModifier
for a swim lane (see thespanEvent
parameters of renderTimeSpanEvent).Parameters:
Name Type Description index
number The index of the swim lane for which the spacing modifier is calculated. Swim lanes are indexed from top to bottom in the time span events panel, starting with index zero.
- Since:
-
8.0.0
Returns:
The number of pixels of the spacing modifier.
- Type
- number
-
checkSetPanelHeight()
-
Helper function used to check and set the required height of the time span events panel.
Typically called when the chart is resized, the layout changes, or a swim lane is added or removed from the time span events panel.
Does nothing if the
params.height
parameter is provided to the CIQ.TimeSpanEventPanel constructor function.- Since:
-
8.0.0
-
createEventDetailPanel()
-
Creates the information pop-up display that appears when a time span event marker is selected.
Parameters:
Name Type Description params.stx
CIQ.ChartEngine The chart object to which the pop-up display is added.
- Since:
-
8.0.0
-
display(on)
-
Creates and displays the panel or destroys the panel depending on the state.
Parameters:
Name Type Description on
Boolean State Boolean that determines whether to show or destroy the panel;
true
= display,false
= destroy.- Since:
-
7.2.0
-
removeChartArtifacts(type)
-
Helper function to remove all the injection and markers from the main chart.
Parameters:
Name Type Description type
string The type of marker that needs its injections and markers removed.
- Since:
-
7.2.0
-
removeTimeSpanEvent(type)
-
Removes time span events from the panel.
Parameters:
Name Type Description type
string The type of time span events to remove from the panel; for example, "News" or "CEO". See the
spanEvent.type
property in showTimeSpanEvent.- Since:
-
7.2.0
-
renderTimeSpanEvent(spanEvents)
-
Creates time span event markers.
Parameters:
Name Type Description spanEvents
object Defines a swim lane (horizontal row) of time span events.
Properties
Name Type Argument Description type
string Identifies the swim lane and the type of events contained in the swim lane; for example, "News" or "CEO". Values are implementation specific.
events
Array.<object> An array of objects that define the individual time span events that appear in the swim lane.
spanType
string Categorizes the time span events contained in the swim lane. Must be one of the following: "spanEvent", "durationEvent", or "singleEvent".
infoPanel
string <optional>
Specifies the panel where pop-up displays appear when a marker is selected. Must be "panel" or "main" for the pop-up displays to appear in the time span events panel or main chart area, respectively. To prevent pop-up displays from appearing, set the value to null or a string that is not "panel" or "main". Note: This parameter overrides the respective value in the
infoPanel
parameter of CIQ.TimeSpanEventPanel.spacingModifier
number Specifies the amount of space between time span event swim lanes.
- Since:
-
- 7.2.0
- 8.0.0 Added the
infoPanel
parameter.
-
showEventDetail(marker, panel, cx)
-
Sets the position and shows or hides the information pop-up display for a time span event marker.
Parameters:
Name Type Description marker
object The selected time span event marker for which the pop-up display is shown or hidden.
panel
object The panel containing the selected marker.
cx
number The x-axis coordinate used to calculate the position of the left edge of the pop-up display for a
spanEvent
type marker.- Since:
-
8.0.0
Returns:
true, if the function has processed and responded to selection of a
singleEvent
type marker.- Type
- boolean
-
showTimeSpanEvent(spanEvent [, preLoad])
-
Displays time span events in the panel.
Parameters:
Name Type Argument Description spanEvent
object Defines a swim lane (horizontal row) of time span events.
Properties
Name Type Argument Description type
string Identifies the swim lane and the type of events contained in the swim lane; for example, "Reports", "Weather", "Filings". Values are implementation specific.
events
Array.<object> An array of objects that define the individual time span events that appear in the swim lane.
spanType
string Categorizes the time span events contained in the swim lane. Must be one of the following: "spanEvent", "durationEvent", or "singleEvent".
infoPanel
string <optional>
Specifies the panel where information pop-up displays appear when a marker is selected. Must be "panel" or "main" for the pop-up displays to appear in the time span events panel or main chart area, respectively. To prevent pop-up displays from appearing, set the value to null or a string other than "panel" or "main". Note: This parameter overrides the respective value in the
infoPanel
parameter of CIQ.TimeSpanEventPanel.preLoad
boolean <optional>
If
true
, the event data already exists, which is the case when time span event data is loaded before the panel is active.- Since:
-
- 7.2.0
- 8.0.0 Added the
infoPanel
parameter.