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 thealwaysZoomproperty.
Example
Declare a time span event panel and enable/disable using commands to be triggered from a menu.
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
-
Enables event zoom on any time span event regardless of whether the event has sub-children.
Note: Individual event markers can set their own
alwaysZoomproperty for more granular control (see CIQ.Marker.TimeSpanEvent). If a marker sets itsalwaysZoomproperty to false, the marker's property takes precedence, and the marker zooms only if it has sub-children.- 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 lanesnumber 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
spacingModifierfor a swim lane (see thespanEventparameters of renderTimeSpanEvent).Parameters:
Name Type Description indexnumber 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.heightparameter 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.stxCIQ.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 onBoolean 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 typestring 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 typestring The type of time span events to remove from the panel; for example, "News" or "CEO". See the
spanEvent.typeproperty in showTimeSpanEvent.- Since:
-
7.2.0
-
renderTimeSpanEvent(spanEvents)
-
Creates time span event markers.
Parameters:
Name Type Description spanEventsobject Defines a swim lane (horizontal row) of time span events.
Properties
Name Type Argument Description typestring Identifies the swim lane and the type of events contained in the swim lane; for example, "News" or "CEO". Values are implementation specific.
eventsArray.<object> An array of objects that define the individual time span events that appear in the swim lane.
spanTypestring Categorizes the time span events contained in the swim lane. Must be one of the following: "spanEvent", "durationEvent", or "singleEvent".
infoPanelstring <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
infoPanelparameter of CIQ.TimeSpanEventPanel.spacingModifiernumber Specifies the amount of space between time span event swim lanes.
- Since:
-
- 7.2.0
- 8.0.0 Added the
infoPanelparameter.
-
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 markerobject The selected time span event marker for which the pop-up display is shown or hidden.
panelobject The panel containing the selected marker.
cxnumber The x-axis coordinate used to calculate the position of the left edge of the pop-up display for a
spanEventtype marker.- Since:
-
8.0.0
Returns:
true, if the function has processed and responded to selection of a
singleEventtype marker.- Type
- boolean
-
showTimeSpanEvent(spanEvent [, preLoad])
-
Displays time span events in the panel.
Parameters:
Name Type Argument Description spanEventobject Defines a swim lane (horizontal row) of time span events.
Properties
Name Type Argument Description typestring Identifies the swim lane and the type of events contained in the swim lane; for example, "Reports", "Weather", "Filings". Values are implementation specific.
eventsArray.<object> An array of objects that define the individual time span events that appear in the swim lane.
spanTypestring Categorizes the time span events contained in the swim lane. Must be one of the following: "spanEvent", "durationEvent", or "singleEvent".
infoPanelstring <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
infoPanelparameter of CIQ.TimeSpanEventPanel.preLoadboolean <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
infoPanelparameter.
