Class that represents a single polygon from the collection of a PolarPolygonSeries.

The geometry of the polygon can be mutated at any time.

Note, that the style of PolarPolygons is managed by the owning PolarPolygonSeries, to change the style, refer to the API of the Series.

Example usage:

 const polygonSeries = polarChart.addPolygonSeries()
let ang = 45
let amplitude = 50
const polygon = polygonSeries.addPolygon()
.setGeometry([
{ angle: (ang += 10), amplitude: (amplitude += 10) },
{ angle: (ang += 10), amplitude: (amplitude += 5) },
{ angle: (ang += 10), amplitude: (amplitude += 10) },
{ angle: (ang += 10), amplitude: (amplitude -= 5) },
{ angle: (ang += 10), amplitude: (amplitude += 5) },
{ angle: (ang += 5), amplitude: (amplitude -= 5) },
{ angle: (ang += 0), amplitude: (amplitude -= 10) },
{ angle: (ang -= 5), amplitude: (amplitude -= 5) },
{ angle: (ang -= 10), amplitude: (amplitude -= 10) },
{ angle: (ang -= 10), amplitude: (amplitude -= 5) },
{ angle: (ang -= 10), amplitude: (amplitude += 5) },
{ angle: (ang -= 10), amplitude: (amplitude += 10) },
])

Hierarchy

  • PolarPolygon

Implements

Methods

  • Permanently destroy the component.

    To fully allow Garbage-Collection to free the resources used by the component, make sure to remove any references to the component and its children in application code.

    let chart = ...ChartXY()
    let axisX = chart.getDefaultAxisX()
    // Dispose Chart, and remove all references so that they can be garbage-collected.
    chart.dispose()
    chart = undefined
    axisX = undefined

    Returns

    Object itself for fluent interface

    Returns PolarPolygon

  • Get polygon geometry as a list of PolarPoints.

    NOTE: points have to be in either clockwise or counter-clockwise order

    Returns

    List of PolarPoints that form the contour of the desired polygon. Automatically closed.

    Returns undefined | PolarPoint[]

  • Get element visibility.

    Returns

    true when element is set to be visible and false otherwise.

    Returns boolean

  • Remove event listener from dispose event.

    Returns

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

    Parameters

    • token: Token

      Token of event listener which has to be removed

    Returns boolean

  • Remove event listener from visibleStateChanged

    Parameters

    • token: Token

    Returns boolean

  • Subscribe onDispose event. This event is triggered whenever the Control (Dashboards and all chart types) is disposed.

     // Example usage

    Chart.onDispose(() => {
    console.log('chert was disposed')
    })

    Chart.dispose()

    Returns

    Token of subscription

    Parameters

    Returns Token

  • Register new event listener to visibleStateChanged event.

    Parameters

    • listener: VisibleStateChangedHandler<PolarPolygon>

      Event listener for visibleStateChanged

    Returns Token

  • Set polygon geometry as a list of PolarPoints.

    NOTE: points have to be in either clockwise or counter-clockwise order. The polygon coordinates should also not intersect with themselves.

    Example usage:

     let ang = 45
    let amplitude = 50
    polarPolygon.setGeometry([
    { angle: (ang += 10), amplitude: (amplitude += 10) },
    { angle: (ang += 10), amplitude: (amplitude += 5) },
    { angle: (ang += 10), amplitude: (amplitude += 10) },
    { angle: (ang += 10), amplitude: (amplitude -= 5) },
    { angle: (ang += 10), amplitude: (amplitude += 5) },
    { angle: (ang += 5), amplitude: (amplitude -= 5) },
    { angle: (ang += 0), amplitude: (amplitude -= 10) },
    { angle: (ang -= 5), amplitude: (amplitude -= 5) },
    { angle: (ang -= 10), amplitude: (amplitude -= 10) },
    { angle: (ang -= 10), amplitude: (amplitude -= 5) },
    { angle: (ang -= 10), amplitude: (amplitude += 5) },
    { angle: (ang -= 10), amplitude: (amplitude += 10) },
    ])

    Parameters

    • geometry: PolarPoint[]

      List of PolarPoints that form the contour of the desired polygon. Automatically closed.

    Returns PolarPolygon

  • Set mouse interactions enabled or disabled

    Returns

    Object itself for fluent interface

    Parameters

    • state: boolean

      Specifies state of mouse interactions

    Returns PolarPolygon

  • Set element visibility.

    Returns

    Object itself.

    Parameters

    • state: boolean

      true when element should be visible and false when element should be hidden.

    Returns PolarPolygon