APIdia Launch Partner
Top Description Fields Constructors Methods
javafx.scene.chart

public Class BubbleChart<X, Y>

extends XYChart<X, Y>
Class Inheritance
Type Parameters
<X>
the X axis value type
<Y>
the Y axis value type
Imports
java.util.ArrayList, .Iterator, .List, javafx.animation.FadeTransition, .ParallelTransition, javafx.beans.NamedArg, javafx.collections.FXCollections, .ObservableList, javafx.scene.AccessibleAttribute, .AccessibleRole, .Node, javafx.scene.layout.StackPane, javafx.scene.shape.Ellipse, javafx.util.Duration, com.sun.javafx.charts.Legend.LegendItem

Chart type that plots bubbles for the data points in a series. The extra value property of Data is used to represent the radius of the bubble it should be a java.lang.Number.
Since
JavaFX 2.0

Field Summary

Modifier and TypeField and Description
private ParallelTransition
Inherited from javafx.scene.chart.XYChart:
DEFAULT_COLORseriesColorMap

Constructor Summary

AccessConstructor and Description
public
BubbleChart(Axis<X>
The x axis to use
xAxis
,
Axis<Y>
The y axis to use
yAxis
)

Construct a new BubbleChart with the given axis.

public
BubbleChart(Axis<X>
The x axis to use
xAxis
,
Axis<Y>
The y axis to use
yAxis
,
ObservableList<XYChart.Series<X, Y>>
The data to use, this is the actual list used so any changes to it will be reflected in the chart
data
)

Construct a new BubbleChart with the given axis and data.

Method Summary

Modifier and TypeMethod and Description
private Node

Returns:

Node used for given data item
createBubble
(XYChart.Series<X, Y> series, int
The index of the series containing the item
seriesIndex
,
final XYChart.Data<X, Y>
The data item to create node for
item
,
int
The index of the data item in the series
itemIndex
)

Create a Bubble for a given data item if it doesn't already have a node

pack-priv Legend.LegendItem
createLegendItemForSeries(XYChart.Series<X, Y> series, int seriesIndex)

Overrides javafx.scene.chart.XYChart.createLegendItemForSeries.

Called by the updateLegend for each series in the chart in order to create new legend item

protected void
dataItemAdded(XYChart.Series<X, Y> series, int itemIndex, XYChart.Data<X, Y> item)

Implements abstract javafx.scene.chart.XYChart.dataItemAdded.

Called when a data item has been added to a series.

protected void
dataItemChanged(XYChart.Data<X, Y> item)

Implements abstract javafx.scene.chart.XYChart.dataItemChanged.

Called when a data item has changed, ie its xValue, yValue or extraValue has changed.

protected void
dataItemRemoved(final XYChart.Data<X, Y> item, final XYChart.Series<X, Y> series)

Implements abstract javafx.scene.chart.XYChart.dataItemRemoved.

Called when a data item has been removed from data model but it is still visible on the chart.

private static double

Returns:

number converted to double or nullDefault
getDoubleValue
(Object
Object possibly a instance of Number
number
,
double
What value to return if the number object is null or not a Number
nullDefault
)

Used to get a double value from a object that can be a Number object or null

protected void
layoutPlotChildren()

Implements abstract javafx.scene.chart.XYChart.layoutPlotChildren.

Called to update and layout the plot children.

protected void
seriesAdded(XYChart.Series<X, Y> series, int seriesIndex)

Implements abstract javafx.scene.chart.XYChart.seriesAdded.

A series has been added to the charts data model.

pack-priv void
seriesBeingRemovedIsAdded(XYChart.Series<X, Y> series)

Overrides javafx.scene.chart.XYChart.seriesBeingRemovedIsAdded.

This method is called when there is an attempt to add series that was set to be removed, and the removal might not have completed.

protected void
seriesRemoved(final XYChart.Series<X, Y> series)

Implements abstract javafx.scene.chart.XYChart.seriesRemoved.

A series has been removed from the data model but it is still visible on the chart.

protected void
updateAxisRange()

Overrides javafx.scene.chart.XYChart.updateAxisRange.

This is called when the range has been invalidated and we need to update it.

Inherited from javafx.scene.chart.XYChart:
alternativeColumnFillVisiblePropertyalternativeRowFillVisiblePropertycreateSeriesRemoveTimeLinecurrentDisplayedExtraValuePropertycurrentDisplayedXValuePropertycurrentDisplayedYValuePropertydataBeingRemovedIsAddeddataPropertygetClassCssMetaDatagetCssMetaDatagetCurrentDisplayedExtraValuegetCurrentDisplayedXValuegetCurrentDisplayedYValuegetDatagetDataSizegetDisplayedDataIteratorgetDisplayedSeriesIteratorgetPlotChildrengetSeriesIndexgetSeriesSizegetVerticalGridLinesVisiblegetXAxisgetYAxishorizontalGridLinesVisiblePropertyhorizontalZeroLineVisiblePropertyisAlternativeColumnFillVisibleisAlternativeRowFillVisibleisHorizontalGridLinesVisibleisHorizontalZeroLineVisibleisVerticalZeroLineVisiblelayoutChartChildrenremoveDataItemFromDisplayremoveSeriesFromDisplayseriesChangedsetAlternativeColumnFillVisiblesetAlternativeRowFillVisiblesetCurrentDisplayedExtraValuesetCurrentDisplayedXValuesetCurrentDisplayedYValuesetDatasetHorizontalGridLinesVisiblesetHorizontalZeroLineVisiblesetSuppressAnimationsetVerticalGridLinesVisiblesetVerticalZeroLineVisibleshouldAnimateupdateLegendupdateSymbolFocusableverticalGridLinesVisiblePropertyverticalZeroLineVisibleProperty

Field Detail

parallelTransitionback to summary
private ParallelTransition parallelTransition

Constructor Detail

BubbleChartback to summary
public BubbleChart(Axis<X> xAxis, Axis<Y> yAxis)

Construct a new BubbleChart with the given axis. BubbleChart does not use a Category Axis. Both X and Y axes should be of type NumberAxis.

Parameters
xAxis:Axis<X>

The x axis to use

yAxis:Axis<Y>

The y axis to use

BubbleChartback to summary
public BubbleChart(Axis<X> xAxis, Axis<Y> yAxis, ObservableList<XYChart.Series<X, Y>> data)

Construct a new BubbleChart with the given axis and data. BubbleChart does not use a Category Axis. Both X and Y axes should be of type NumberAxis.

Parameters
xAxis:Axis<X>

The x axis to use

yAxis:Axis<Y>

The y axis to use

data:ObservableList<XYChart.Series<X, Y>>

The data to use, this is the actual list used so any changes to it will be reflected in the chart

Method Detail

createBubbleback to summary
private Node createBubble(XYChart.Series<X, Y> series, int seriesIndex, final XYChart.Data<X, Y> item, int itemIndex)

Create a Bubble for a given data item if it doesn't already have a node

Parameters
seriesIndex:int

The index of the series containing the item

item:XYChart.Data<X, Y>

The data item to create node for

itemIndex:int

The index of the data item in the series

Returns:Node

Node used for given data item

createLegendItemForSeriesback to summary
pack-priv Legend.LegendItem createLegendItemForSeries(XYChart.Series<X, Y> series, int seriesIndex)

Overrides javafx.scene.chart.XYChart.createLegendItemForSeries.

Doc from javafx.scene.chart.XYChart.createLegendItemForSeries.

Called by the updateLegend for each series in the chart in order to create new legend item

Annotations
@Override
dataItemAddedback to summary
protected void dataItemAdded(XYChart.Series<X, Y> series, int itemIndex, XYChart.Data<X, Y> item)

Implements abstract javafx.scene.chart.XYChart.dataItemAdded.

Doc from javafx.scene.chart.XYChart.dataItemAdded.

Called when a data item has been added to a series. This is where implementations of XYChart can create/add new nodes to getPlotChildren to represent this data item. They also may animate that data add with a fade in or similar if animated = true.

Annotations
@Override
dataItemChangedback to summary
protected void dataItemChanged(XYChart.Data<X, Y> item)

Implements abstract javafx.scene.chart.XYChart.dataItemChanged.

Doc from javafx.scene.chart.XYChart.dataItemChanged.

Called when a data item has changed, ie its xValue, yValue or extraValue has changed.

Annotations
@Override
dataItemRemovedback to summary
protected void dataItemRemoved(final XYChart.Data<X, Y> item, final XYChart.Series<X, Y> series)

Implements abstract javafx.scene.chart.XYChart.dataItemRemoved.

Doc from javafx.scene.chart.XYChart.dataItemRemoved.

Called when a data item has been removed from data model but it is still visible on the chart. Its still visible so that you can handle animation for removing it in this method. After you are done animating the data item you must call removeDataItemFromDisplay() to remove the items node from being displayed on the chart.

Annotations
@Override
getDoubleValueback to summary
private static double getDoubleValue(Object number, double nullDefault)

Used to get a double value from a object that can be a Number object or null

Parameters
number:Object

Object possibly a instance of Number

nullDefault:double

What value to return if the number object is null or not a Number

Returns:double

number converted to double or nullDefault

layoutPlotChildrenback to summary
protected void layoutPlotChildren()

Implements abstract javafx.scene.chart.XYChart.layoutPlotChildren.

Doc from javafx.scene.chart.XYChart.layoutPlotChildren.

Called to update and layout the plot children. This should include all work to updates nodes representing the plot on top of the axis and grid lines etc. The origin is the top left of the plot area, the plot area with can be got by getting the width of the x axis and its height from the height of the y axis.

Annotations
@Override
seriesAddedback to summary
protected void seriesAdded(XYChart.Series<X, Y> series, int seriesIndex)

Implements abstract javafx.scene.chart.XYChart.seriesAdded.

Doc from javafx.scene.chart.XYChart.seriesAdded.

A series has been added to the charts data model. This is where implementations of XYChart can create/add new nodes to getPlotChildren to represent this series. Also you have to handle adding any data items that are already in the series. You may simply call dataItemAdded() for each one or provide some different animation for a whole series being added.

Annotations
@Override
seriesBeingRemovedIsAddedback to summary
pack-priv void seriesBeingRemovedIsAdded(XYChart.Series<X, Y> series)

Overrides javafx.scene.chart.XYChart.seriesBeingRemovedIsAdded.

Doc from javafx.scene.chart.XYChart.seriesBeingRemovedIsAdded.

This method is called when there is an attempt to add series that was set to be removed, and the removal might not have completed.

Annotations
@Override
seriesRemovedback to summary
protected void seriesRemoved(final XYChart.Series<X, Y> series)

Implements abstract javafx.scene.chart.XYChart.seriesRemoved.

Doc from javafx.scene.chart.XYChart.seriesRemoved.

A series has been removed from the data model but it is still visible on the chart. Its still visible so that you can handle animation for removing it in this method. After you are done animating the data item you must call removeSeriesFromDisplay() to remove the series from the display list.

Annotations
@Override
updateAxisRangeback to summary
protected void updateAxisRange()

Overrides javafx.scene.chart.XYChart.updateAxisRange.

This is called when the range has been invalidated and we need to update it. If the axis are auto ranging then we compile a list of all data that the given axis has to plot and call invalidateRange() on the axis passing it that data.

Annotations
@Override