class
LinePlot
extends Band
Band type that plots a line along the timeline.
- Properties
- background, borderColor, borderWidth, contentHeight, data, fill, frozen, headerBackground, height, label, labelBackground, labelFontFamily, labelFormatter, labelTextColor, labelTextSize, lineColor, lineWidth, lines, marginBottom, marginTop, maximum, minimum, pointColor, pointHoverRadius, pointRadius, timeline, width, x, y, zeroLineColor, zeroLineDash, zeroLineWidth
- Methods
- constructor, addHeaderClickListener, addMutationListener, addPointClickListener, addPointHoverListener, beforeDraw, calculateContentHeight, createAnimatableProperty, disconnectedCallback, drawBandContent, drawContent, drawOverlay, drawUnderlay, removeHeaderClickListener, removeMutationListener, removePointClickListener, removePointHoverListener, reportMutation
Properties
- backgroundgetset
Background of this band.
- Type:
-
FillStyle
- borderColorgetset
Border color of this band. If undefined, the color is determined by the property ‘bandBorderColor’ of the Timeline instance.
- Type:
-
undefined | string
- borderWidthgetset
Border width of this band. If undefined, the width is determined by the property ‘bandBorderWidth’ of the Timeline instance.
- Type:
-
undefined | number
- contentHeightgetset
The height of the band content (excluding margins).
- Type:
-
number
- Default value:
- 30
- datagetset
Arbitrary data. For example an identifier of a backend system.
- Type:
-
any
- fillgetset
Area fill between the plot line and the value 0.
- Type:
-
FillStyle
- Default value:
- 'transparent'
- frozengetset
If set to true, this band stays fixed on top, even while scrolling vertically.
Frozen bands precede non-frozen bands, regardless of the order in which bands were added.
- Type:
-
boolean
- headerBackgroundgetset
Background of the header of this band.
- Type:
-
FillStyle
- heightget
The height of this band.
- Type:
-
number
- labelgetset
Human-friendly label for this band. Used in sidebar.
- Type:
-
undefined | string
- labelBackgroundgetset
Background color of any value labels.
- Type:
-
FillStyle
- Default value:
- 'transparent'
- labelFontFamilygetset
Font family of any value labels.
- Type:
-
string
- Default value:
- 'Verdana, Geneva, sans-serif'
- labelFormattergetset
Function that formats a point value to string.
The default behaviour is to format with 2 digits after the decimal point.
- Type:
-
(value: number) => string
- labelTextColorgetset
Text color of any value labels.
- Type:
-
string
- Default value:
- '#333333'
- labelTextSizegetset
Size of any value labels.
- Type:
-
number
- Default value:
- 8
- lineColorgetset
Color of the line that connects data points.
- Type:
-
string
- Default value:
- '#4f9146'
- lineWidthgetset
Thickness of the plot line.
- Type:
-
number
- Default value:
- 1
- linesgetset
- Type:
-
Line[]
- Default value:
- []
- marginBottomgetset
Whitespace in points between the bottom of this band and band content.
- Type:
-
number
- marginTopgetset
Whitespace in points between the top of this band and band content.
- Type:
-
number
- maximumgetset
Value that corresponds with the maximum value on the curve. If undefined, the value is automatically derived from the plot data.
- Type:
-
undefined | number
- minimumgetset
Value that corresponds with the minimum value on the curve. If undefined, the value is automatically derived from the plot data.
- Type:
-
undefined | number
- pointColorgetset
Color of the point symbol.
- Type:
-
string
- Default value:
- '#4f9146'
- pointHoverRadiusgetset
Radius of the point symbol when hovered.
- Type:
-
number
- Default value:
- 4
- pointRadiusgetset
Radius of the point symbol.
- Type:
-
number
- Default value:
- 1.5
- timelineget
Timeline instance that this instance is bound to.
- Type:
-
Timeline
- widthget
The width of this band.
- Type:
-
number
- xget
The X-coordinate of this band.
- Type:
-
number
- yget
The Y-coordinate of this band.
- Type:
-
number
- zeroLineColorgetset
Color of the line at value zero.
- Type:
-
string
- Default value:
- '#e8e8e8'
- zeroLineDashgetset
Dash pattern of the line at value zero.
- Type:
-
number[]
- zeroLineWidthgetset
Width of the line at value zero.
- Type:
-
number
- Default value:
- 0
Methods
- constructor(timeline)
- Parameters:
-
-
Timeline
timelineTimeline instance that this instance is bound to.
-
- addHeaderClickListener(listener)
Register a listener that receives updates when a line header is clicked.
- Parameters:
-
-
(ev: HeaderClickEvent) => void
listener
-
- Return type:
void
- addMutationListener(mutationListener)
Adds a listener that is notified whenever one of the properties changes.
This method is used by the Timeline instance to detect when to redraw the Canvas.
- Parameters:
-
-
() => void
mutationListener
-
- Return type:
void
- addPointClickListener(listener)
Register a listener that receives an update when a point on a Line is clicked.
- Parameters:
-
-
(ev: PointClickEvent) => void
listener
-
- Return type:
void
- addPointHoverListener(listener)
Register a listener that receives an update when a point on a Line is hovered.
- Parameters:
-
-
(ev: PointHoverEvent) => void
listener
-
- Return type:
void
- beforeDraw(g)
Gets called before any of the draw methods.
- Parameters:
-
-
Graphics
g
-
- Return type:
void
- calculateContentHeight(g)
Implementations should return required content height (excluding margins) during the current draw operation.
- Parameters:
-
-
Graphics
g
-
- Return type:
number
- createAnimatableProperty(value)
Creates an animatable property.
Animatable properties apply easing over time between numeric value changes.
- Parameters:
-
-
number
value –
-
- Return type:
AnimatableProperty
- disconnectedCallback()
Called when this drawable is removed from its Timeline
- Return type:
void
- drawBandContent(g)
- Parameters:
-
-
Graphics
g
-
- Return type:
void
- drawContent(g)
Draw regular content.
- Parameters:
-
-
Graphics
g
-
- Return type:
void
- drawOverlay(g)
Gets called after regular content is drawn. Override this if you need a top layer.
- Parameters:
-
-
Graphics
g
-
- Return type:
void
- drawUnderlay(g)
Gets called before regular content is drawn. Override this if you need a bottom layer.
- Parameters:
-
-
Graphics
g
-
- Return type:
void
- removeHeaderClickListener(listener)
Unregister a previously registered listener to stop receiving header click events.
- Parameters:
-
-
(ev: HeaderClickEvent) => void
listener
-
- Return type:
void
- removeMutationListener(mutationListener)
Remove a previously added mutation listener.
- Parameters:
-
-
() => void
mutationListener
-
- Return type:
void
- removePointClickListener(listener)
Unregister a previously registered listener to stop receiving click events.
- Parameters:
-
-
(ev: PointClickEvent) => void
listener
-
- Return type:
void
- removePointHoverListener(listener)
Unregister a previously registered listener to stop receiving hover events.
- Parameters:
-
-
(ev: PointHoverEvent) => void
listener
-
- Return type:
void
- reportMutation()
Mark this Drawable as dirty. This method is intended for use in subclasses and should be called in the implementation of set accessors.
- Return type:
void