Class RadarSeries

java.lang.Object
com.codename1.ui.chart.Series
com.codename1.ui.chart.series.RadarSeries

public class RadarSeries extends Series

A radar (spider) chart: one polygon per series over a shared set of spokes. All radar series in a chart share the spokes of the first one and one radial scale.

Chart chart = new Chart();
String[] skills = {"Speed", "Power", "Range", "Defense", "Stamina"};
chart.addSeries(new RadarSeries("Alice", skills).setValues(8, 6, 7, 5, 9));
chart.addSeries(new RadarSeries("Bob", skills).setValues(5, 9, 4, 8, 6));

A radar chart

  • Constructor Details

    • RadarSeries

      public RadarSeries(String name, String... spokes)

      Creates a radar series.

      Parameters
      • name: the series name

      • spokes: the name of each spoke; may be null on all but the first radar series

  • Method Details

    • isCartesian

      public boolean isCartesian()
      Description copied from class: Series
      True for series drawn against x and y axes; false for pies, treemaps and other series that fill the plot themselves.
      Specified by:
      isCartesian in class Series
    • setValues

      public RadarSeries setValues(double... v)

      Replaces the values, one per spoke, animated.

      Parameters
      • v: the values
      Returns

      this series

    • getValue

      public double getValue(int i)
      The value on spoke i.
    • setFillAlpha

      public RadarSeries setFillAlpha(float a)

      The opacity of the polygon's fill.

      Parameters
      • a: 0 to 1
      Returns

      this series

    • captureTransitionStart

      protected void captureTransitionStart()
      Description copied from class: Series
      Records the values currently on screen as the start of the next transition. Called by the chart before data changes; a subclass with animated data overrides it.
      Overrides:
      captureTransitionStart in class Series
    • captureEntryStart

      protected void captureEntryStart()
      Description copied from class: Series
      Records a zero baseline as the start of the entry animation.
      Overrides:
      captureEntryStart in class Series
    • paint

      public void paint(ChartContext ctx)
      Description copied from class: Series

      Paints the series.

      Parameters
      • ctx: the current frame: graphics, plot area, axes and animation progress
      Specified by:
      paint in class Series
    • getPointCount

      public int getPointCount()
      Description copied from class: Series
      The number of points along x, for a shared tooltip; -1 when not index aligned.
      Overrides:
      getPointCount in class Series
    • getPoint

      public ChartPoint getPoint(ChartContext ctx, int i)
      Description copied from class: Series
      The point at index for a shared tooltip, or null.
      Overrides:
      getPoint in class Series
    • hitTest

      public ChartPoint hitTest(ChartContext ctx, int x, int y, int radius)
      Description copied from class: Series

      Finds the data point nearest a screen position.

      Parameters
      • ctx: the frame the series was last painted in

      • x: chart relative x

      • y: chart relative y

      • radius: how far from the point a touch may land and still hit it

      Returns

      the point, or null

      Overrides:
      hitTest in class Series
    • formatTooltip

      public String formatTooltip(ChartContext ctx, ChartPoint p)
      Description copied from class: Series

      The tooltip row for a point: the series or point name and its formatted value. Series with several values per point (open/high/low/close, ranges, box plots) override this.

      Parameters
      • ctx: the last paint context

      • p: the point

      Returns

      one line of text

      Overrides:
      formatTooltip in class Series
    • collectTableRows

      public void collectTableRows(List<String[]> rows)
      Description copied from class: Series

      Adds this series' data to an accessible table, one {series, item, value} row per point. Used by Chart.toTable() and the chart's accessibility text.

      Parameters
      • rows: the list to append rows to
      Overrides:
      collectTableRows in class Series