Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SpiderSeries

Class that represents a collection of linked data-points inside a SpiderChart.

Given data is visualized in the form of a polygon, where each SpiderPoint is an edge along an Axis. This polygon can be styled with 3 independent areas:

  • fill
  • border
  • points

Data is pushed with SpiderSeries.addPoints in form: { axis: string, value: number }

Index

Properties

Readonly scale

scale : LinearScaleXY

Methods

addPoints

  • Adds an arbitrary amount of SpiderPoints to the Series.

    Animates transition if its enabled on owning chart.

    Parameters

    • ...points: SpiderPoint[]

      List of SpiderPoints as {'axis': string, 'value': number}

    Returns this

    Object itself

attach

  • Attach object to an legendBox entry

    Parameters

    • entry: LegendBoxEntry

      Object which has to be attached

    • 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

dispose

  • dispose(): this
  • Enable or disable the series

    Returns this

    Series itself for fluent interface

getAutoScrollingEnabled

  • getAutoScrollingEnabled(): boolean
  • Get whether series is taken into account with automatic scrolling and fitting of attached axes.

    By default, this is true for all series.

    Returns boolean

    true default, axes will take series into account in scrolling and fitting operations. false, axes will ignore series boundaries.

getCursorEnabled

  • getCursorEnabled(): boolean
  • Returns boolean

    Whether Cursor is enabled or not

getCursorResultTableFormatter

  • Get ResultTable Formatter.

    Returns SpiderSeriesFormatter

    Function which builds ResultTable content for SpiderSeries.

getFillStyle

  • Returns FillStyle

    Current series fill style

getFillStyleHighlight

  • getFillStyleHighlight(): FillStyle | undefined
  • Gets the highlighted fillStyle of the Polygon that represents the shape of this Series

    Returns FillStyle | undefined

getHighlightOnHover

  • getHighlightOnHover(): boolean
  • Get boolean flag for whether object should highlight on mouse hover

    Returns boolean

    Boolean for if object should highlight on mouse hover or not.

getHighlighted

  • getHighlighted(): boolean

getIsUnderMouse

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

    Returns boolean

    Boolean for is object under mouse currently

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

getPointFillStyleHighlight

  • getPointFillStyleHighlight(): FillStyle | undefined
  • Returns FillStyle | undefined

    Current highlight point fill style

getPointRotation

  • getPointRotation(): number
  • Get the current rotation of points.

    Returns number

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

getStrokeStyle

  • Gets the stroke style of the Polygon that represents the shape of this Series

    Returns LineStyle

getStrokeStyleHighlight

  • getStrokeStyleHighlight(): LineStyle | undefined
  • Get stroke style of highlighted polygon.

    Returns LineStyle | undefined

    LineStyle or undefined for auto assignment

getValue

  • getValue(tag: string, animated: boolean): number | undefined
  • Returns the respective value of a data-point with the given tag (if any)

    Parameters

    • tag: string
    • animated: boolean

      If set to true, will take series animating into account for result

    Returns number | undefined

isDisposed

  • isDisposed(): boolean
  • Returns boolean

    TODO: True for enabled and false for disabled

offHighlight

  • offHighlight(token: Token): boolean
  • Unsubscribe from Highlight object event. This is called whenever an object is highlighted

    Parameters

    • token: Token

      Token that was received when subscribing to the event.

    Returns boolean

    True if the unsubscription was successful.

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

onHighlight

  • onHighlight(handler: function): Token
  • Subscribe to highlight object event. This is called whenever an object is highlighted.

    Parameters

    • handler: function

      Function that is called when event is triggered.

        • Parameters

          • isHighlighted: boolean

          Returns void

    Returns Token

    Token that can be used to unsubscribe from the event.

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: any | 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

onTouchEnd

  • Subscribe to Touch End event

    Parameters

    Returns Token

    Token of subscription

onTouchMove

onTouchStart

restore

  • restore(): this
  • Enable or disable the series

    Returns this

    Series itself for fluent interface

setAnimationAddPoints

  • setAnimationAddPoints(easing?: AnimationEasing, duration?: undefined | number): this
  • Set animation for adding points.

    Parameters

    • easing: AnimationEasing

      Type of easing for animation or undefined to disable animations

    • duration: undefined | number

      Custom duration for animation in milliseconds.

    Returns this

    Object itself

setAutoScrollingEnabled

  • setAutoScrollingEnabled(enabled: boolean): this
  • Set whether series is taken into account with automatic scrolling and fitting of attached axes.

    By default, this is true for all series.

    By setting this to false, any series can be removed from axis scrolling/fitting.

     // Example syntax, remove series from automatic scrolling / fitting.
     LineSeries.setAutoScrollingEnabled(false)
    

    Parameters

    • enabled: boolean

      true default, axes will take series into account in scrolling and fitting operations. false, axes will ignore series boundaries.

    Returns this

    Object itself for fluent interface.

setCursorEnabled

  • setCursorEnabled(state: boolean): this
  • Configure whether cursors should pick on this particular series or not.

     // Example, prevent chart auto cursor from snapping to a series.
     LineSeries.setCursorEnabled(false)
    

    Related API:

    • setCursorResultTableFormatter | configure formatting of result table contents, when this series is pointed.
    • setCursorSolveBasis | configure basis of finding nearest data point for the series ('nearest-x', 'nearest', etc.). This method is not available for all series types (more support will be added in near future).
    • setCursorInterpolationEnabled | configure whether cursor should interpolate the displayed data point between the two closest data points, or snap to the nearest real data point. This method is not available for all series types.
    • ChartXY.setAutoCursorMode | configure behavior when auto cursor is visible.

    Parameters

    • state: boolean

    Returns this

setCursorResultTableFormatter

  • Configure formatting of Cursor ResultTable when pointing at this series.

     // Example usage
     SpiderSeries.setCursorResultTableFormatter((tableBuilder, series, value, axis) => {
         return tableBuilder
             .addRow(`Pointing at`, '', series.getName())
             .addRow(`Category:`, '', axis)
             .addRow(`Value:`, '', value.toFixed(1))
     })
    

    The general syntax of configuring ResultTable formatting is shared between all series types; You specify a callback function, which receives a TableContentBuilder. The contents of the table are then set using methods of the table builder:

     // Using TableContentBuilder.
     SpiderSeries.setCursorResultTableFormatter((tableBuilder, series, value, axis) => {
         // addRow adds a list of strings to a new row in the table. Empty strings ('') will allocate any extra horizontal space within the row.
         tableBuilder
             .addRow('Item 0:', '', 'Value 0')
             .addRow('Item 1:', '', 'Value 1')
             .addRow('Long row that highlights the idea of empty strings')
    
         // After configuration, the table builder must be returned!
         return tableBuilder
     })
    

    The additional values that are supplied to the callback function vary between different chart types, refer to the series documentation of setCursorResultTableFormatter to learn the exact available information. All Spider Series receive three extra parameters:

    1. series | reference to the series itself.
    2. value | pointed data point value.
    3. axis | pointed data point category (name of spider axis).

    Related API:

    Parameters

    Returns this

    Object itself

setDisposeAnimation

  • setDisposeAnimation(easing?: AnimationEasing, duration?: undefined | number): this
  • Set animation for disabling/enabling series.

    Parameters

    • easing: AnimationEasing

      Type of easing for animation or undefined to disable animations

    • duration: undefined | number

      Custom duration for animation in milliseconds.

    Returns this

    Object itself

setFillStyle

  • Set fill style of the Polygon that represents the shape of the Series.

    Example use:

    // Create a new style
    SpiderSeries.setFillStyle(new SolidFill({ color: ColorHEX('#F00') }))
    // Change transparency
    SpiderSeries.setFillStyle((solidFill) => solidFill.setA(80))
    // Set hidden
    SpiderSeries.setFillStyle(emptyFill)
    

    Parameters

    Returns this

    Series itself for fluent interface.

setFillStyleHighlight

  • Set fill style of the highlighted Polygon that represents the shape of the Series.

    Example use:

    // Create a new style
    SpiderSeries.setFillStyleHighlight(new SolidFill({ color: ColorHEX('#F00') }))
    // Change transparency
    SpiderSeries.setFillStyleHighlight((solidFill) => solidFill.setA(80))
    // Set hidden
    SpiderSeries.setFillStyleHighlight(emptyFill)
    // Automatic
    SpiderSeries.setFillStyleHighlight(undefined)
    

    Parameters

    Returns this

    Series itself for fluent interface.

setHighlightOnHover

  • setHighlightOnHover(state: boolean): this
  • Set highlight on mouse hover enabled or disabled.

    Mouse interactions have to be enabled on the component for this to function as expected. See setMouseInteractions for more information.

    Parameters

    • state: boolean

      True if highlighting on mouse hover, false if no highlight on mouse hover

    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

setMouseInteractions

  • setMouseInteractions(state: boolean): this
  • Set component mouse interactions enabled or disabled.

    Disabling mouse interactions means that the objects below this component can be interacted through it.

    Possible side-effects from disabling mouse interactions:

    • Mouse events are not triggered. For example, onMouseMove.
    • Mouse driven highlighting will not work.

    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 object to enable individual coloring of points.

    Example usage:

    // Create a new style
    SpiderSeries.setPointFillStyle(new SolidFill({ color: ColorHEX('#F00') }))
    // Change transparency
    SpiderSeries.setPointFillStyle((solidFill) => solidFill.setA(80))
    // Set hidden
    SpiderSeries.setPointFillStyle(emptyFill)
    

    Parameters

    Returns this

    Series itself for fluent interface.

setPointFillStyleHighlight

  • Set point fill style of Series when it is highlighted.

    Example usage:

    // Create a new style
    SpiderSeries.setPointFillStyleHighlight(new SolidFill({ color: ColorHEX('#F00') }))
    // Change transparency
    SpiderSeries.setPointFillStyleHighlight((solidFill) => solidFill.setA(80))
    // Set hidden
    SpiderSeries.setPointFillStyleHighlight(emptyFill)
    // Automatic
    SpiderSeries.setPointFillStyleHighlight(undefined)
    

    Parameters

    Returns this

    Series itself for fluent interface.

setPointRotation

  • setPointRotation(angle: number): this
  • Set the rotation of points in degrees.

    Parameters

    • angle: number

      Rotation angle in degrees

    Returns this

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

setStrokeStyle

  • Set stroke style of the Polygon that represents the shape of the Series.

    Example usage:

    // Specified LineStyle
    SpiderSeries.setStrokeStyle(new SolidLine({ thickness: 2, fillStyle: new SolidFill({ color: ColorHEX('#F00') }) }))
    // Changed thickness
    SpiderSeries.setStrokeStyle((solidLine) => solidLine.setThickness(5))
    // Hidden
    SpiderSeries.setStrokeStyle(emptyLine)
    

    Parameters

    Returns this

    Chart itself

setStrokeStyleHighlight

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

    Example usage:

    // Specified LineStyle
    SpiderSeries.setStrokeStyleHighlight(new SolidLine({ thickness: 2, fillStyle: new SolidFill({ color: ColorHEX('#F00') }) }))
    // Changed thickness
    SpiderSeries.setStrokeStyleHighlight((solidLine) => solidLine.setThickness(5))
    // Hidden
    SpiderSeries.setStrokeStyleHighlight(emptyLine)
    // Automatic
    SpiderSeries.setStrokeStyleHighlight(undefined)
    

    Parameters

    Returns this

    Chart itself

solveNearestFromScreen

  • Solves the nearest datapoint to a given coordinate on screen.

    Parameters

    • location: Point

      Location on screen

    Returns undefined | CursorPoint

    Undefined or data-structure for positioning of cursors

solveNearestFromSegment

  • Solves the nearest datapoint to a given coordinate on a screen from a specific segment.

    Parameters

    • location: Point

      Location on screen

    Returns undefined | CursorPoint

    Undefined or data-structure for positioning of cursors