Class ScatterSeries
Unconnected points. Giving the points sizes turns it into a bubble chart: the bubble's area, not its radius, is proportional to the size value, so big values do not look quadratically bigger than they are.

-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(double x, double y, double size) Appends a bubble, sliding the window when a maximum is set.protected doubleauxDefault(int channel, double y) intThe number of points along x, for a shared tooltip; -1 when not index aligned.intThe number of pointsChart.setSelectionand arrow-key stepping can reach by index.doublegetSize(int i) The size of pointi, NaN when it has none.double[]The extent of the data along x,{min, max}, or null when empty or not cartesian.double[]The extent of the data along y,{min, max}, or null when empty or not cartesian.hitTest(ChartContext ctx, int x, int y, int radius) Finds the data point nearest a screen position.protected booleanisAuxRelative(int channel) True when extra channelchannelis a value on the y scale (a high, a low, a quartile) and so animates as an offset from the point's value; false for a channel of its own scale, such as a bubble size, which animates by itself.voidpaint(ChartContext ctx) Paints the series.setData(double[] x, double[] y, double[] sizes) Replaces all points with bubbles of the given sizes.setMaxBubbleSize(float mm) Diameter of the largest bubble in millimetres.setPointSize(float mm) Diameter of plain points in millimetres.setSizes(double... sizes) Sets a size per point of the points the series holds now, making this a bubble series; null for plain points.Methods inherited from class XYSeries
add, add, addRow, animatedAux, animatedBase, animatedY, captureEntryStart, captureTransitionStart, clear, collectTableRows, consumesStackBase, dataChanged, getAux, getBase, getMinXSpacing, getPoint, getStackGroup, getX, getXBoundsWithin, getY, hasOwnBase, isAscending, isCartesian, isGapAt, lowerBound, nearestIndexOfX, nearestScreenIndex, screenPosition, set, setData, setMaxPoints, setRows, setStackGroup, setValues, size, tableValue, targetBase, transitionEnded, visibleRangeMethods inherited from class Series
attached, detached, formatTooltip, formatValue, getChart, getColor, getLegendEntryCount, getLegendEntryName, getName, getValueFormatter, getVisibilityFraction, handleTap, isGap, isLegendEntryVisible, isPointCountFromLayout, isSecondaryAxis, isShowValues, isVisible, lerp, paintLegendEntrySymbol, paintLegendSymbol, repaintChart, setColor, setName, setSecondaryAxis, setShowValues, setValueFormatter, setVisible, toggleLegendEntry
-
Constructor Details
-
ScatterSeries
Creates an empty scatter series.
Parameters
name: the legend name
-
-
Method Details
-
setSizes
Sets a size per point of the points the series holds now, making this a bubble series; null for plain points. A point past the end ofsizes, or with a NaN size, is drawn as a plain dot. Sizes move with their points as points are added, removed or slide out of asetMaxPointswindow; usesetData(double[], double[], double[])oradd(double, double, double)to give new points theirs. -
setData
Replaces all points with bubbles of the given sizes.
Parameters
-
x: x values, or null for 0, 1, 2... -
y: the values -
sizes: one size per point, NaN for a plain dot; null for plain points, assetSizes(null)does
-
-
add
Appends a bubble, sliding the window when a maximum is set.
Parameters
-
x: the x value -
y: the value -
size: the bubble size, NaN for a plain dot
-
-
getSize
public double getSize(int i) The size of pointi, NaN when it has none. -
isAuxRelative
protected boolean isAuxRelative(int channel) Description copied from class:XYSeriesTrue when extra channel
channelis a value on the y scale (a high, a low, a quartile) and so animates as an offset from the point's value; false for a channel of its own scale, such as a bubble size, which animates by itself.Parameters
channel: the extra channel
Returns
true by default
- Overrides:
isAuxRelativein classXYSeries
-
auxDefault
protected double auxDefault(int channel, double y) - Overrides:
auxDefaultin classXYSeries
-
setPointSize
Diameter of plain points in millimetres. -
setMaxBubbleSize
Diameter of the largest bubble in millimetres. -
paint
Description copied from class:SeriesPaints the series.
Parameters
ctx: the current frame: graphics, plot area, axes and animation progress
-
hitTest
Description copied from class:SeriesFinds 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
-
-
getPointCount
public int getPointCount()Description copied from class:SeriesThe number of points along x, for a shared tooltip; -1 when not index aligned.- Overrides:
getPointCountin classXYSeries
-
getSelectablePointCount
public int getSelectablePointCount()Description copied from class:SeriesThe number of pointsChart.setSelectionand arrow-key stepping can reach by index. The same asgetPointCount(), except for a series whose points are not index aligned with other series (scatter), which still has its own points to select.- Overrides:
getSelectablePointCountin classSeries
-
getXBounds
public double[] getXBounds()Description copied from class:SeriesThe extent of the data along x,{min, max}, or null when empty or not cartesian.- Overrides:
getXBoundsin classXYSeries
-
getYBounds
public double[] getYBounds()Description copied from class:SeriesThe extent of the data along y,{min, max}, or null when empty or not cartesian.- Overrides:
getYBoundsin classXYSeries
-