Class: TimeSpanEvent

CIQ.Marker. TimeSpanEvent


new TimeSpanEvent(params)

Constructor for time span event markers.

Parameters:
Name Type Description
params Object

The object that defines the time span event.

Properties
Name Type Argument Description
stx CIQ.ChartEngine

The chart engine.

startDate Date

The date that starts the time span event.

endDate Date

The date that ends the time span event.

label string

The label that is displayed on the yAxis and used in the uniqueId to identify the time span event itself.

spanLabel string

The label that is displayed on the time span event itself.

panelName string

The name of the time span event panel.

spacing number

The amount of pixels to place between time span events to artificially create rows.

spacingModifier number

The amount of pixels to place the time span event from the top of the yAxis. Calculated by the following formula (params.spacing*(Unique tse turned on + 1)) where unique tse is 0 to begin.

bgColor string

The color you want the time span event to display.

textColor string

The color you want the time span event spanLabel to display.

subChildren array <optional>

An array of objects that contain important dates to place onto the chart.

headline string <optional>

The headline you want to put on the high performance marker.

story string <optional>

The story you want to put on the high performance marker.

Since:
  • 7.2.0

Methods


<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
dataSegment Object

the stx.chart.dataSegement

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 if an indicator needs to be drawn on the span event

Type
Object

<static> placementFunction(params)

Function that will determine the placement of the time span events.

Parameters:
Name Type Description
params Object

parameters passed from the Marker render function

Properties
Name Type Description
stx CIQ.ChartEngine

the chart engine

panel Object

the panel that 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 some ellipsis on the end of the string.

Parameters:
Name Type Description
ctx 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(cx, cy, marker, panel)

Function that will be called when a time span event marker is clicked.

Parameters:
Name Type Description
cx Number

the x-coordinate that was clicked on the chart

cy Number

the y-coordinate that was clicked on the chart

marker Object

the object that defines the time span event

panel Object

the panel where the marker was clicked

Since:
  • TBD 14092

drawOnChart(params)

Function that will draw 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 pixel value of the startDate

pixelRight number

x pixel value of the endDate

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

Since:
  • 7.2.0

drawSelected(params)

Function that will draw 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 pixel value of the startDate

pixelRight number

x pixel value of the endDate

yPixel number

y pixel value that the time span event is located

color string

color value to fill/stroke the time span event shape

Since:
  • 7.2.0

drawSingleOrDurationEvent(spanEvent)

Draw a single or duration event on the time span event panel. Duration event will usually have sub data.

Parameters:
Name Type Description
spanEvent Object

the object that defines the time span event

Since:
  • 7.2.0

drawSpanEvent(spanEvent)

Draw a span event on the time span event panel.

Parameters:
Name Type Description
spanEvent Object

the object that defines the time span event

Since:
  • 7.2.0

placeLabelOnYAxis(spanEvent)

Function that will place a time span event label on the time span event panel y-Axis.

Parameters:
Name Type Description
spanEvent Object

the object that defines the time span event

Since:
  • 7.2.0