Class SankeySeries
A sankey diagram: flows between stages drawn as bands whose thickness is the flow's value.
Nodes are created by name as links mention them.
SankeySeries s = new SankeySeries("Energy");
s.addLink("Solar", "Grid", 40).addLink("Gas", "Grid", 60).addLink("Grid", "Homes", 55).addLink("Grid", "Industry", 45);

-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a flow, creating its nodes if needed.protected voidRecords a zero baseline as the start of the entry animation.clear()Removes all nodes and links.voidcollectTableRows(List<String[]> rows) Adds this series' data to an accessible table, one{series, item, value}row per point.protected voidTells the chart this series' data changed, which animates the new values in.formatTooltip(ChartContext ctx, ChartPoint p) The tooltip row for a point: the series or point name and its formatted value.intThe number of links.intThe number of nodes.getPoint(ChartContext ctx, int index) Points0..nodeCount-1are nodes, the rest are links.intThe number of points along x, for a shared tooltip; -1 when not index aligned.hitTest(ChartContext ctx, int x, int y, int radius) Finds the data point nearest a screen position.booleanTrue for series drawn against x and y axes; false for pies, treemaps and other series that fill the plot themselves.voidpaint(ChartContext ctx) Paints the series.setLinkAlpha(float a) The opacity of the link bands.Methods inherited from class Series
attached, captureTransitionStart, detached, formatValue, getChart, getColor, getLegendEntryCount, getLegendEntryName, getName, getSelectablePointCount, getValueFormatter, getVisibilityFraction, getXBounds, getXBoundsWithin, getYBounds, handleTap, isGap, isLegendEntryVisible, isPointCountFromLayout, isSecondaryAxis, isShowValues, isVisible, lerp, paintLegendEntrySymbol, paintLegendSymbol, repaintChart, setColor, setName, setSecondaryAxis, setShowValues, setValueFormatter, setVisible, toggleLegendEntry, transitionEnded
-
Constructor Details
-
SankeySeries
Creates an empty diagram.
Parameters
name: the series name
-
-
Method Details
-
isCartesian
public boolean isCartesian()Description copied from class:SeriesTrue for series drawn against x and y axes; false for pies, treemaps and other series that fill the plot themselves.- Specified by:
isCartesianin classSeries
-
addLink
Adds a flow, creating its nodes if needed.
Parameters
-
source: the source node's name -
target: the target node's name -
value: the amount that flows
Returns
this series
-
-
clear
Removes all nodes and links.
Returns
this series
-
setLinkAlpha
The opacity of the link bands.
Parameters
a: 0 to 1
Returns
this series
-
getNodeCount
public int getNodeCount()The number of nodes. -
getLinkCount
public int getLinkCount()The number of links. -
captureEntryStart
protected void captureEntryStart()Description copied from class:SeriesRecords a zero baseline as the start of the entry animation.- Overrides:
captureEntryStartin classSeries
-
dataChanged
protected void dataChanged()Description copied from class:SeriesTells the chart this series' data changed, which animates the new values in.- Overrides:
dataChangedin classSeries
-
paint
Description copied from class:SeriesPaints the series.
Parameters
ctx: the current frame: graphics, plot area, axes and animation progress
-
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 classSeries
-
getPoint
Points0..nodeCount-1are nodes, the rest are links. -
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
-
-
formatTooltip
Description copied from class:SeriesThe 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:
formatTooltipin classSeries
-
-
collectTableRows
Description copied from class:SeriesAdds this series' data to an accessible table, one
{series, item, value}row per point. Used byChart.toTable()and the chart's accessibility text.Parameters
rows: the list to append rows to
- Overrides:
collectTableRowsin classSeries
-