Top Description Fields Constructors Methods
javafx.scene.chart

public Class ScatterChart<X, Y>

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

Chart type that plots symbols for the data points in a series.
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
ScatterChart(Axis<X>
The x axis to use
xAxis
,
Axis<Y>
The y axis to use
yAxis
)

Construct a new ScatterChart with the given axis and data.

public
ScatterChart(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 ScatterChart with the given axis and data.

Method Summary

Modifier and TypeMethod and Description
pack-priv Legend.LegendItem
createLegendItemForSeries(XYChart.Series<X, Y>
the series for this legend item
series
,
int
the index of the series
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>
The series the data item was added to
series
,
int
The index of the new item within the series
itemIndex
,
XYChart.Data<X, Y>
The new data item that was added
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>
The data item who was changed
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>
The item that has been removed from the series
item
,
final XYChart.Series<X, Y>
The series the item was removed from
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.

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>
The series that has been added
series
,
int
The index of the new series
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>
The series that has been removed
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.

Inherited from javafx.scene.chart.XYChart:
alternativeColumnFillVisiblePropertyalternativeRowFillVisiblePropertycreateSeriesRemoveTimeLinecurrentDisplayedExtraValuePropertycurrentDisplayedXValuePropertycurrentDisplayedYValuePropertydataBeingRemovedIsAddeddataPropertygetClassCssMetaDatagetCssMetaDatagetCurrentDisplayedExtraValuegetCurrentDisplayedXValuegetCurrentDisplayedYValuegetDatagetDataSizegetDisplayedDataIteratorgetDisplayedSeriesIteratorgetPlotChildrengetSeriesIndexgetSeriesSizegetVerticalGridLinesVisiblegetXAxisgetYAxishorizontalGridLinesVisiblePropertyhorizontalZeroLineVisiblePropertyisAlternativeColumnFillVisibleisAlternativeRowFillVisibleisHorizontalGridLinesVisibleisHorizontalZeroLineVisibleisVerticalZeroLineVisiblelayoutChartChildrenremoveDataItemFromDisplayremoveSeriesFromDisplayseriesChangedsetAlternativeColumnFillVisiblesetAlternativeRowFillVisiblesetCurrentDisplayedExtraValuesetCurrentDisplayedXValuesetCurrentDisplayedYValuesetDatasetHorizontalGridLinesVisiblesetHorizontalZeroLineVisiblesetVerticalGridLinesVisiblesetVerticalZeroLineVisibleupdateAxisRangeupdateLegendverticalGridLinesVisiblePropertyverticalZeroLineVisibleProperty

Field Detail

parallelTransitionback to summary
private ParallelTransition parallelTransition

Constructor Detail

ScatterChartback to summary
public ScatterChart(Axis<X> xAxis, Axis<Y> yAxis)

Construct a new ScatterChart with the given axis and data.

Parameters
xAxis:Axis<X>

The x axis to use

yAxis:Axis<Y>

The y axis to use

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

Construct a new ScatterChart with the given axis and data.

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

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

Parameters
series:XYChart.Series<X, Y>

the series for this legend item

seriesIndex:int

the index of the series

Returns:Legend.LegendItem

new legend item for this series

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.

Parameters
series:XYChart.Series<X, Y>

The series the data item was added to

itemIndex:int

The index of the new item within the series

item:XYChart.Data<X, Y>

The new data item that was added

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.

Parameters
item:XYChart.Data<X, Y>

The data item who was 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.

Parameters
item:XYChart.Data<X, Y>

The item that has been removed from the series

series:XYChart.Series<X, Y>

The series the item was removed from

Annotations
@Override
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.

Parameters
series:XYChart.Series<X, Y>

The series that has been added

seriesIndex:int

The index of the new series

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.

Parameters
series:XYChart.Series<X, Y>

The series that has been removed

Annotations
@Override