Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public class RadarSeries

  1. Object
  2. Series
  3. RadarSeries

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

Constructors

public RadarSeries(String name, String... spokes)Creates a radar series.

Methods

public boolean isCartesian()True for series drawn against x and y axes; false for pies, treemaps and other series that fill the plot themselves.
public RadarSeries setValues(double... v)Replaces the values, one per spoke, animated.
public double getValue(int i)The value on spoke i.
public RadarSeries setFillAlpha(float a)The opacity of the polygon’s fill.
protected void captureTransitionStart()Records the values currently on screen as the start of the next transition.
protected void captureEntryStart()Records a zero baseline as the start of the entry animation.
public void paint(ChartContext ctx)Paints the series.
public int getPointCount()The number of points along x, for a shared tooltip; -1 when not index aligned.
public ChartPoint getPoint(ChartContext ctx, int i)The point at index for a shared tooltip, or null.
public ChartPoint hitTest(ChartContext ctx, int x, int y, int radius)Finds the data point nearest a screen position.
public String formatTooltip(ChartContext ctx, ChartPoint p)The tooltip row for a point: the series or point name and its formatted value.
public void collectTableRows(List<String[]> rows)Adds this series’ data to an accessible table, one {series, item, value} row per point.

Inherited methods

Constructor details

RadarSeries

public RadarSeries(String name, String... spokes)
Creates a radar series.

Parameters

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

Method details

isCartesian

public boolean isCartesian()
True for series drawn against x and y axes; false for pies, treemaps and other series that fill the plot themselves.

setValues

public RadarSeries setValues(double... v)
Replaces the values, one per spoke, animated.

Parameters

v double...
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 float
0 to 1

Returns

this series

captureTransitionStart

protected void captureTransitionStart()
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.

captureEntryStart

protected void captureEntryStart()
Records a zero baseline as the start of the entry animation.

paint

public void paint(ChartContext ctx)
Paints the series.

Parameters

ctx ChartContext
the current frame: graphics, plot area, axes and animation progress

getPointCount

public int getPointCount()
The number of points along x, for a shared tooltip; -1 when not index aligned.

getPoint

public ChartPoint getPoint(ChartContext ctx, int i)
The point at index for a shared tooltip, or null.

hitTest

public ChartPoint hitTest(ChartContext ctx, int x, int y, int radius)
Finds the data point nearest a screen position.

Parameters

ctx ChartContext
the frame the series was last painted in
x int
chart relative x
y int
chart relative y
radius int
how far from the point a touch may land and still hit it

Returns

the point, or null

formatTooltip

public String formatTooltip(ChartContext ctx, ChartPoint p)
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 ChartContext
the last paint context
p ChartPoint
the point

Returns

one line of text

collectTableRows

public void collectTableRows(List<String[]> rows)
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 List<String[]>
the list to append rows to