Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PointLineSeries <CursorPointInterface >

Implementation of SeriesXY for visualizing a collection of Points with a specifiable PointShape and connected lines.

PointLineSeries are created with ChartXY.addPointLineSeries

Index

Properties

_theme

_theme: Theme

Theme from owning Chart, used for styling

axisX

axisX: Axis

Axis X

axisY

axisY: Axis

Axis Y

chart

chart: ChartXY

scale

scale: Vec2<Scale>

Scale of the series

Methods

_findPreviouslyAddedData

  • _findPreviouslyAddedData(): Point[]
  • Method that finds and lists all data that has been added to the Series.

    This method is only called when a ZoomBandChart is first created, so its performance is not important.

    Returns Point[]

    List of data points in order of addition.

_offDataAdd

  • _offDataAdd(token: Token): boolean
  • Unsubscribe from data add event. This is called whenever new data is added to the Series.

    Parameters

    • token: Token

      Token that was received when subscribing to the event.

    Returns boolean

    True if the unsubscription was successful.

_offDataClear

  • _offDataClear(token: Token): boolean
  • Unsubscribe from data clear event. This is called whenever all data of the Series is cleared.

    Parameters

    • token: Token

      Token that was received when subscribing to the event.

    Returns boolean

    True if the unsubscription was successful.

_onDataAdd

  • _onDataAdd(handler: function): Token
  • Subscribe to data add event. This is called whenever new data is added to the Series.

    Parameters

    • handler: function

      Function that is called when event is triggered.

        • Parameters

          • series: this
          • data: Point[]
          • Optional boundaries: Interval<Point>

          Returns void

    Returns Token

    Token that can be used to unsubscribe from the event.

_onDataClear

  • _onDataClear(handler: function): Token
  • Subscribe to data clear event. This is called whenever all data of the Series is cleared.

    Parameters

    • handler: function

      Function that is called when event is triggered.

        • Parameters

          • series: this

          Returns void

    Returns Token

    Token that can be used to unsubscribe from the event.

add

  • Add Point or Array of Points.

    Parameters

    • points: Point | Point[]

      Point or Array of Points.

    Returns this

    Object itself for fluent interface.

addArrayX

  • addArrayX(arrayX: number[], step: number, start?: undefined | number): this
  • Each X-value will be paired with an automatically generated Y-value, based on step-argument. This method will cause some overhead based on amount of data added, using add method is recommended.

    Parameters

    • arrayX: number[]

      Array of X-values.

    • Default value step: number

      Optional step between each Y coordinate. Defaults to 1.

    • Optional start: undefined | number

      Optional value for first generated Y-value. If undefined, will continue after last point's Y value in series, or 0 if there are no points in series.

    Returns this

    Object itself for fluent interface.

addArrayY

  • addArrayY(arrayY: number[], step: number, start: number): this
  • Each Y-value will be paired with an automatically generated X-value, based on step-argument.

    Parameters

    • arrayY: number[]

      Array of Y-values.

    • Default value step: number

      Optional step between each X coordinate. Defaults to 1.

    • Default value start: number

      Optional value for first generated X-value. If undefined, will continue after last point's X value in series, or 0 if there are no points in series.

    Returns this

    Object itself for fluent interface.

addArraysXY

  • addArraysXY(arrayX: number[], arrayY: number[]): this
  • Add two individual Arrays, one for X-values, and another for Y-values.

    Parameters

    • arrayX: number[]

      Array of X-values.

    • arrayY: number[]

      Array of Y-values. Length should be equal to length of arrayX.

    Returns this

    Object itself for fluent interface.

addMarker

  • addMarker(cursorBuilder: StaticCursorXYBuilder<PointMarkerType, ResultTableBackgroundType, TickMarkerBackgroundTypeX, TickMarkerBackgroundTypeY>): SeriesMarkerXY<PointMarkerType, ResultTableBackgroundType, TickMarkerBackgroundTypeX, TickMarkerBackgroundTypeY>
  • Add Marker to the Series.

    Type parameters

    Parameters

    • Default value cursorBuilder: StaticCursorXYBuilder<PointMarkerType, ResultTableBackgroundType, TickMarkerBackgroundTypeX, TickMarkerBackgroundTypeY>

      StaticCursorBuilderXY object for customized look of marker. MarkerBuilders.XY can be used to build a custom one from scratch.

    Returns SeriesMarkerXY<PointMarkerType, ResultTableBackgroundType, TickMarkerBackgroundTypeX, TickMarkerBackgroundTypeY>

    SeriesMarkerXY

attach

  • Attach object to an legendBox entry

    Parameters

    • entry: LegendBoxEntry

      Object which has to be attached

    • Default value disposeOnClick: boolean

      Flag that indicates whether the Attachable should be disposed/restored, when its respective Entry is clicked.

    Returns this

    Series itself for fluent interface

clear

  • clear(): this
  • Clear all points and segments from the dataset.

    Returns this

    Series itself for fluent interface

dispose

  • dispose(): this
  • Remove everything related to the object from all collections associated with rendering cycle and allows the object to be collected by GC

    Returns this

    Object itself for fluent interface

getCursorEnabled

  • getCursorEnabled(): boolean
  • Returns boolean

    Whether Cursor is enabled or not

getCursorInterpolationEnabled

  • getCursorInterpolationEnabled(): boolean
  • Get if cursor interpolates solved data-points along series by default.

    Returns boolean

    Boolean flag

getHighlighted

  • getHighlighted(): boolean
  • Returns boolean

    the state of highlighted flag

getIsUnderMouse

  • getIsUnderMouse(): boolean
  • Get boolean flag for whether object is currently under mouse or not

    Returns boolean

    Boolean for is object under mouse currently

getLastPoint

  • getLastPoint(): Point | undefined
  • Returns Point | undefined

    Copy of last point added to the Series or undefined if it doesn't exist.

getMaxPointCount

  • getMaxPointCount(): number | undefined
  • Get amount of points that series should keep around at all times (data-cleaning won't touch them).

    Returns number | undefined

    Number of points, or undefined if data-cleaning is disabled

getMouseInteractions

  • getMouseInteractions(): boolean
  • Get mouse interactions enabled or disabled. Disabled mouse-interactions will naturally prevent mouse-driven highlighting from ever happening.

    Returns boolean

    Mouse interactions state

getName

  • getName(): string
  • Get the name of the Component.

    Returns string

    The name of the Component.

getPointFillStyle

  • Get normal points fill style.

    Returns FillStyle

    Normal point fill style.

getPointFillStyleHighlight

  • Returns FillStyle

    Current highlight point fill style

getPointShape

  • Get shape of points.

    This is defined upon creation of series, and cannot be changed afterwards.

    Returns PointShape

    PointShape

getPointSize

  • getPointSize(): number
  • Returns number

    Size of point in pixels

getResultTableFormatter

  • Get ResultTable Formatter.

    Returns SeriesXYFormatter

    Function which builds ResultTable content for SeriesXY.

getStrokeStyle

  • Get stroke style of Series.

    Returns SolidLine

    SolidLine object

getStrokeStyleHighlight

  • Get stroke style of Series when it is highlighted. Highlighting is activated by placing mouse on top / touching Series (if mouse-interactions are not disabled), or by using setHighlighted() method.

    Returns SolidLine

    SolidLine object

getXMax

  • getXMax(): number | undefined
  • Returns number | undefined

    Max X value of the series

getXMin

  • getXMin(): number | undefined
  • Returns number | undefined

    Min X value of the series

getYMax

  • getYMax(): number | undefined
  • Returns number | undefined

    Max Y value of the series

getYMin

  • getYMin(): number | undefined
  • Returns number | undefined

    Min Y value of the series

isDisposed

  • isDisposed(): boolean
  • Returns boolean

    TODO: True for enabled and false for disabled

offHover

  • offHover(token: Token): boolean
  • Remove event listener from Series Hover Event.

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseClick

  • offMouseClick(token: Token): boolean
  • Remove event listener from Mouse Click Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseDoubleClick

  • offMouseDoubleClick(token: Token): boolean
  • Remove event listener from Mouse Double Click Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseDown

  • offMouseDown(token: Token): boolean
  • Remove event listener from Mouse Down Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseDrag

  • offMouseDrag(token: Token): boolean
  • Remove event listener from Mouse Drag Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseDragStart

  • offMouseDragStart(token: Token): boolean
  • Remove event listener from Mouse Drag Start Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseDragStop

  • offMouseDragStop(token: Token): boolean
  • Remove event listener from Mouse Drag Stop Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseEnter

  • offMouseEnter(token: Token): boolean
  • Remove event listener from Mouse Enter Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseLeave

  • offMouseLeave(token: Token): boolean
  • Remove event listener from Mouse Leave Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseMove

  • offMouseMove(token: Token): boolean
  • Remove event listener from Mouse Move Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseUp

  • offMouseUp(token: Token): boolean
  • Remove event listener from Mouse Up Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offMouseWheel

  • offMouseWheel(token: Token): boolean
  • Remove event listener from Mouse Wheel Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offTouchEnd

  • offTouchEnd(token: Token): boolean
  • Remove event listener from Touch End Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offTouchMove

  • offTouchMove(token: Token): boolean
  • Remove event listener from Touch Move Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

offTouchStart

  • offTouchStart(token: Token): boolean
  • Remove event listener from Touch Start Event

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

    True if the listener is successfully removed and false if it is not found

onHover

  • onHover(clbk: function): Token
  • Add event listener to Series Hover Event. Hover event is a custom mouse-event designed for Series that is the main link between Cursors and Series.

    Parameters

    • clbk: function

      Callback function that is called whenever mouse enters / moves or leaves the Series

        • Parameters

          • series: this
          • cursorPoint: CursorPointInterface | undefined

          Returns void

    Returns Token

    Token of the event listener

onMouseClick

  • Add event listener to Mouse Click Event

    Parameters

    Returns Token

    Token of the event listener

onMouseDoubleClick

  • Add event listener to Mouse Double Click Event

    Parameters

    Returns Token

    Token of the event listener

onMouseDown

  • Add event listener to Mouse Down Event

    Parameters

    Returns Token

    Token of the event listener

onMouseDrag

onMouseDragStart

onMouseDragStop

onMouseEnter

  • Add event listener to Enter Event

    Parameters

    Returns Token

    Token of the event listener

onMouseLeave

  • Add event listener to Mouse Leave Event

    Parameters

    Returns Token

    Token of the event listener

onMouseMove

  • Add event listener to Mouse Move Event

    Parameters

    Returns Token

    Token of the event listener

onMouseUp

  • Add event listener to Mouse Up Event

    Parameters

    Returns Token

    Token of the event listener

onMouseWheel

  • Subscribe to Mouse Wheel event

    Parameters

    Returns Token

    Token of subscription

onTouchEnd

  • Subscribe to Touch End event

    Parameters

    Returns Token

    Token of subscription

onTouchMove

  • Subscribe to Touch Move event

    Parameters

    Returns Token

    Token of subscription

onTouchStart

  • Subscribe to Touch Start event

    Parameters

    Returns Token

    Token of subscription

restore

  • restore(): this
  • Tell the owning chart to restore this series.

    Returns this

    Object itself.

setCursorEnabled

  • setCursorEnabled(state: boolean): this
  • Set whether Cursor is enabled or not

    Parameters

    • state: boolean

    Returns this

setCursorInterpolationEnabled

  • setCursorInterpolationEnabled(state: boolean): this
  • Set if cursor interpolates solved data-points along series by default.

    Parameters

    • state: boolean

      Boolean flag

    Returns this

    Object itself for fluent interface

setHighlighted

  • setHighlighted(highlight: boolean): this
  • Enable or disable forced highlighting of series

    Parameters

    • highlight: boolean

      True for enabled and false for disabled

    Returns this

    Series itself for fluent interface

setMaxPointCount

  • setMaxPointCount(maxPointCount: number | undefined): this
  • Set amount of points that should be kept around at all times (data-cleaning won't touch them). NOTE: The actual data cleaning can only be started if there is at least 1 full segment (about 8000 points).

    Parameters

    • maxPointCount: number | undefined

      Guaranteed amount of visible points. If undefined or 0 is passed, data-cleaning will be disabled.

    Returns this

    Object itself

setMouseInteractions

  • setMouseInteractions(state: boolean): this
  • Set mouse interactions enabled or disabled. Disabling mouse-interactions will naturally prevent mouse-driven highlighting from ever happening.

    Parameters

    • state: boolean

      Specifies state of mouse interactions

    Returns this

    Object itself for fluent interface

setName

  • setName(name: string): this
  • Sets the name of the Component updating attached LegendBox entries

    Parameters

    • name: string

      Name of the Component

    Returns this

    Object itself

setPointFillStyle

  • Set point fill style of Series. Use IndividualPointFill to enable individual coloring of points.

    Desired result Argument
    Specified FillStyle new SolidFill({ color: ColorHEX('#F00') })
    Changed color (solidFill) => solidFill.setColor( ColorRGBA( 0, 0, 0, 0 ) )
    Hidden emptyFill

    Parameters

    Returns this

    Series itself for fluent interface.

setPointFillStyleHighlight

  • Set point fill style of Series when it is highlighted. Use IndividualPointFill to enable individual coloring of points.

    Desired result Argument
    Specified FillStyle new SolidFill({ color: ColorHEX('#F00') })
    Changed color (solidFill) => solidFill.setColor( ColorRGBA( 0, 0, 0, 0 ) )
    Hidden emptyFill
    Automatic undefined

    Parameters

    • value: FillStyle | ImmutableMutator<FillStyle> | undefined

      Either a FillStyle object or a function, which will be used to create a new FillStyle based on current value or undefined for automatic value based on normal style.

    Returns this

    Series itself for fluent interface.

setPointSize

  • setPointSize(size: number): this
  • Set size of point in pixels

    Parameters

    • size: number

      Size of point in pixels

    Returns this

    Object itself for fluent interface

setResultTableFormatter

  • Method for customizing contents of ResultTables when pointing at this Series.

    Parameters

    Returns this

    Object itself

setStrokeStyle

  • Set stroke style of Series.

    Example usage:

    Desired result Argument
    Specified LineStyle new SolidLine({ thickness: 2, fillStyle: new SolidFill({ color: ColorHEX('#F00') }) })
    Changed thickness (solidLine) => solidLine.setThickness(5)
    Hidden emptyLine Not supported, to hide Series use dispose() method

    Parameters

    Returns this

    Chart itself

setStrokeStyleHighlight

  • Set stroke style of Series when it is highlighted. Highlighting is activated by placing mouse on top / touching Series (if mouse-interactions are not disabled), or by using setHighlighted() method.

    Example usage:

    Desired result Argument
    Solid line new SolidLine({ thickness: 2, fillStyle: new SolidFill({ color: ColorHEX('#F00') }) })
    Changed thickness (solidLine) => solidLine.setThickness(5)
    Hidden emptyLine Not supported, to hide highlighted Series use transparentLine
    Automatic undefined

    Parameters

    • value: SolidLine | ImmutableMutator<SolidLine> | undefined

      Either a SolidLine object or a function, which will be used to modify current value or undefined for automatic value based on normal style.

    Returns this

    Chart itself

solveNearestFromScreen

  • solveNearestFromScreen(location: Point, interpolate: boolean): undefined | CursorPoint
  • Solves the nearest datapoint to a given coordinate on screen.

    Parameters

    • location: Point

      Location on screen

    • Default value interpolate: boolean

    Returns undefined | CursorPoint

    Undefined or data-structure for positioning of cursors

solveNearestFromSegment

  • solveNearestFromSegment(location: Point, segment: LineSet | PointSet, interpolate?: undefined | false | true): undefined | CursorPoint
  • Solves the nearest datapoint to a given coordinate on a screen from a specific segment.

    Parameters

    • location: Point

      Location on screen

    • segment: LineSet | PointSet

      Segment to solve from

    • Optional interpolate: undefined | false | true

    Returns undefined | CursorPoint

    Undefined or data-structure for positioning of cursors