Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PolarPointLineSeries

Type of PolarSeries for visualizing a collection of [[PolarPoints]] by filling them with a specifiable PointShape, as well as connecting them with a line.

PolarPointLineSeries are created with PolarChart.addPointLineSeries.

Set data with [[PolarSeries.setData]]:

 PolarSeries.setData(
     new Array( 90 ).fill( 0 ).map(( _, i ) => ({
         angle: i,
         amplitude: 60 + 25 * Math.cos( 5 * i * Math.PI / 180 )
     }))
 )

Index

Properties

Readonly scale

scale : RadialScale

Scale of the series

Methods

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
  • Tell the owning chart to remove this component.

    Returns this

    Object itself.

getAmplitudeMax

  • getAmplitudeMax(): number | undefined
  • Get max amplitude value of PolarSeries' data points.

    Returns number | undefined

    number or undefined if no data is set.

getAmplitudeMin

  • getAmplitudeMin(): number | undefined
  • Get min amplitude value of PolarSeries' data points.

    Returns number | undefined

    number or undefined if no data is set.

getConnectDataAutomaticallyEnabled

  • getConnectDataAutomaticallyEnabled(): boolean
  • Get automatic connection of first and last data points enabled or not.

    Returns boolean

    Boolean.

getCursorEnabled

  • getCursorEnabled(): boolean
  • Returns boolean

    Whether Cursor is enabled or not

getCursorResultTableFormatter

  • Get ResultTable Formatter.

    Returns PolarSeriesFormatter

    Function which builds ResultTable content for SpiderSeries.

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
  • 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

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 fillStyle

getPointFillStyleHighlight

  • Get current highlight fill style of points.

    Returns FillStyle

    Current highlight point fill style

getPointRotation

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

    Returns number

getPointShape

  • Get shape of points.

    Returns PointShape

    PointShape

getPointSize

  • getPointSize(): number
  • Get current size of points in pixels.

    Returns number

    Size of point in pixels.

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

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

    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 component.

    Returns this

    Object itself.

setConnectDataAutomaticallyEnabled

  • setConnectDataAutomaticallyEnabled(enabled: boolean): this
  • Set automatic connection of first and last data points enabled or not.

    Disabled by default.

    Parameters

    • enabled: boolean

      Boolean.

    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
     PolarLineSeries.setCursorResultTableFormatter((tableBuilder, series, angleDeg, amplitude) => {
         return tableBuilder
             .addRow(`Pointing at`, '', series.getName())
             .addRow(`Angle:`, '', angleDeg.toFixed(0) + ' deg')
             .addRow(`Amplitude:`, '', amplitude.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.
     PolarLineSeries.setCursorResultTableFormatter((tableBuilder, series, angleDeg, amplitude) => {
         // 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 Polar Series receive three extra parameters:

    1. series | reference to the series itself.
    2. angleDeg | pointed data point angle as degrees.
    3. amplitude | pointed data point amplitude.

    Related API:

    Parameters

    Returns this

    Object itself

setData

  • Set data for PolarPointSeries to render as a list of PolarPoints.

    Parameters

    Returns this

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

    Parameters

    • highLight: boolean

      True for enabled and false for disabled

    Returns this

    component 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.

    Example usage:

    // Create a new style
    PolarPointSeries.setPointFillStyle(new SolidFill({ color: ColorHEX('#F00') }))
    // Change transparency
    PolarPointSeries.setPointFillStyle((solidFill) => solidFill.setA(80))
    // Set hidden
    PolarPointSeries.setPointFillStyle(emptyFill)
    // Individual point style (required for using 'color' properties in data points)
    PolarPointSeries.setPointFillStyle(new IndividualPointFill())
    

    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
    PolarPointSeries.setPointFillStyleHighlight(new SolidFill({ color: ColorHEX('#F00') }))
    // Change transparency
    PolarPointSeries.setPointFillStyleHighlight((solidFill) => solidFill.setA(80))
    // Set hidden
    PolarPointSeries.setPointFillStyleHighlight(emptyFill)
    // Automatic
    PolarPointSeries.setPointFillStyleHighlight(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.

setPointRotation

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

    Parameters

    • angle: number

      Rotation angle in degrees

    Returns this

setPointShape

  • Set shape of points.

    Parameters

    Returns this

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

setStrokeStyle

  • Set stroke style of Series.

    Example usage:

    // Specified LineStyle
    PolarLineSeries.setStrokeStyle(new SolidLine({ thickness: 2, fillStyle: new SolidFill({ color: ColorHEX('#F00') }) }))
    // Changed thickness
    PolarLineSeries.setStrokeStyle((solidLine) => solidLine.setThickness(5))
    // Hidden must be done with dispose() method, emptyLine is not supported
    

    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:

    // Specified LineStyle
    PolarLineSeries.setStrokeStyleHighlight(new SolidLine({ thickness: 2, fillStyle: new SolidFill({ color: ColorHEX('#F00') }) }))
    // Changed thickness
    PolarLineSeries.setStrokeStyleHighlight((solidLine) => solidLine.setThickness(5))
    // Hidden must be done with transparentLine, emptyLine is not supported
    PolarLineSeries.setStrokeStyleHighlight(transparentLine)
    // Automatic
    PolarLineSeries.setStrokeStyleHighlight(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

  • Abstract method that solves the nearest datapoint to a given coordinate on screen.

    Parameters

    • location: Point

      Location on screen

    Returns CursorPoint<PolarPointLineSeries> | undefined

    Undefined or data-structure for positioning of cursors

solveNearestFromSegment

  • Abstract method that solves the nearest datapoint to a given coordinate on a screen from a specific segment.

    Parameters

    • location: Point

      Location on screen

    • segment: PointSet | LineSet

      Segment to solve from

    Returns CursorPoint<PolarPointLineSeries> | undefined

    Undefined or data-structure for positioning of cursors