Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PolarPolygon

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

The geometry of the polygon can be mutated at any time, and it can be disposed and restored whenever.

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) },
     ])

Index

Methods

dispose

  • dispose(): this
  • Remove the component from rendering.

    If the Component supports it, this can be reverted with restore() method.

    Returns this

    Object itself for fluent interface.

getGeometry

  • Get polygon geometry as a list of PolarPoints.

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

    Returns PolarPoint[] | undefined

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

isDisposed

  • isDisposed(): boolean
  • Returns boolean

    True if the component is currently disposed, and thus not being rendered. If the Component supports it, this can be reverted with restore() method.

restore

  • restore(): this
  • After the Components dispose() method has been called, removing it from rendering, restore() can be used to return it back.

    Returns this

    Object itself for fluent interface.

setGeometry

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

setMouseInteractions

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

    Parameters

    • state: boolean

      Specifies state of mouse interactions

    Returns this

    Object itself for fluent interface