Module javafx.controls
Package javafx.scene.chart

# Class XYChart.Data<X,Y>

java.lang.Object
javafx.scene.chart.XYChart.Data<X,Y>

Enclosing class:
  `XYChart<X,Y>`

public static final class XYChart.Data<X,Y> extends Object
A single data item with data for 2 axis charts

Since:
  JavaFX 2.0

- ## Property Summary

  Properties
  Type
  Property
  Description
  `final ObjectProperty<Object>`
  `extraValue`
  The generic data value to be plotted in any way the chart needs.
  `final ObjectProperty<Node>`
  `node`
  The node to display for this data item.
  `final ObjectProperty<X>`
  `XValue`
  The generic data value to be plotted on the X axis.
  `final ObjectProperty<Y>`
  `YValue`
  The generic data value to be plotted on the Y axis.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Data()`
  Creates an empty XYChart.Data object.
  `Data(X xValue, Y yValue)`
  Creates an instance of XYChart.Data object and initializes the X,Y data values.
  `Data(X xValue, Y yValue, Object extraValue)`
  Creates an instance of XYChart.Data object and initializes the X,Y data values and extraValue.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final ObjectProperty<Object>`
  `extraValueProperty()`
  The generic data value to be plotted in any way the chart needs.
  `final Object`
  `getExtraValue()`
  Gets the value of the `extraValue` property.
  `final Node`
  `getNode()`
  Gets the value of the `node` property.
  `final X`
  `getXValue()`
  Gets the generic data value to be plotted on the X axis.
  `final Y`
  `getYValue()`
  Gets the generic data value to be plotted on the Y axis.
  `final ObjectProperty<Node>`
  `nodeProperty()`
  The node to display for this data item.
  `final void`
  `setExtraValue(Object value)`
  Sets the value of the `extraValue` property.
  `final void`
  `setNode(Node value)`
  Sets the value of the `node` property.
  `final void`
  `setXValue(X value)`
  Sets the generic data value to be plotted on the X axis.
  `final void`
  `setYValue(Y value)`
  Sets the generic data value to be plotted on the Y axis.
  `String`
  `toString()`
  Returns a string representation of this `Data` object.
  `final ObjectProperty<X>`
  `XValueProperty()`
  The generic data value to be plotted on the X axis.
  `final ObjectProperty<Y>`
  `YValueProperty()`
  The generic data value to be plotted on the Y axis.

  ### Methods declared in class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Property Details

  - ### XValue

    public final ObjectProperty<X> XValueProperty
    The generic data value to be plotted on the X axis.
    See Also:
      - `getXValue()`
      - `setXValue(X)`
      - `XValueProperty()`

  - ### YValue

    public final ObjectProperty<Y> YValueProperty
    The generic data value to be plotted on the Y axis.
    See Also:
      - `getYValue()`
      - `setYValue(Y)`
      - `YValueProperty()`

  - ### extraValue

    public final ObjectProperty<Object> extraValueProperty
    The generic data value to be plotted in any way the chart needs. For example used as the radius for BubbleChart.
    See Also:
      - `getExtraValue()`
      - `setExtraValue(Object)`
      - `extraValueProperty()`

  - ### node

    public final ObjectProperty<Node> nodeProperty
    The node to display for this data item. You can either create your own node and set it on the data item before you add the item to the chart. Otherwise the chart will create a node for you that has the default representation for the chart type. This node will be set as soon as the data is added to the chart. You can then get it to add mouse listeners etc. Charts will do their best to position and size the node appropriately, for example on a Line or Scatter chart this node will be positioned centered on the data values position. For a bar chart this is positioned and resized as the bar for this data item.
    See Also:
      - `getNode()`
      - `setNode(Node)`
      - `nodeProperty()`

- ## Constructor Details

  - ### Data

    public Data()
    Creates an empty XYChart.Data object.

  - ### Data

    public Data(X xValue, Y yValue)
    Creates an instance of XYChart.Data object and initializes the X,Y data values.
    Parameters:
      `xValue` - The X axis data value
      `yValue` - The Y axis data value

  - ### Data

    public Data(X xValue, Y yValue, Object extraValue)
    Creates an instance of XYChart.Data object and initializes the X,Y data values and extraValue.
    Parameters:
      `xValue` - The X axis data value.
      `yValue` - The Y axis data value.
      `extraValue` - Chart extra value.

- ## Method Details

  - ### getXValue

    public final X getXValue()
    Gets the generic data value to be plotted on the X axis.
    Returns:
      the generic data value to be plotted on the X axis.

  - ### setXValue

    public final void setXValue(X value)
    Sets the generic data value to be plotted on the X axis.
    Parameters:
      `value` - the generic data value to be plotted on the X axis.

  - ### XValueProperty

    public final ObjectProperty<X> XValueProperty()
    The generic data value to be plotted on the X axis.
    Returns:
      The XValue property
    See Also:
      - `getXValue()`
      - `setXValue(X)`

  - ### getYValue

    public final Y getYValue()
    Gets the generic data value to be plotted on the Y axis.
    Returns:
      the generic data value to be plotted on the Y axis.

  - ### setYValue

    public final void setYValue(Y value)
    Sets the generic data value to be plotted on the Y axis.
    Parameters:
      `value` - the generic data value to be plotted on the Y axis.

  - ### YValueProperty

    public final ObjectProperty<Y> YValueProperty()
    The generic data value to be plotted on the Y axis.
    Returns:
      the YValue property
    See Also:
      - `getYValue()`
      - `setYValue(Y)`

  - ### getExtraValue

    public final Object getExtraValue()
    Gets the value of the `extraValue` property.
    Property description:
      The generic data value to be plotted in any way the chart needs. For example used as the radius for BubbleChart.
    Returns:
      the value of the `extraValue` property
    See Also:
      - `setExtraValue(Object)`
      - `extraValueProperty()`

  - ### setExtraValue

    public final void setExtraValue(Object value)
    Sets the value of the `extraValue` property.
    Property description:
      The generic data value to be plotted in any way the chart needs. For example used as the radius for BubbleChart.
    Parameters:
      `value` - the value for the `extraValue` property
    See Also:
      - `getExtraValue()`
      - `extraValueProperty()`

  - ### extraValueProperty

    public final ObjectProperty<Object> extraValueProperty()
    The generic data value to be plotted in any way the chart needs. For example used as the radius for BubbleChart.
    Returns:
      the `extraValue` property
    See Also:
      - `getExtraValue()`
      - `setExtraValue(Object)`

  - ### getNode

    public final Node getNode()
    Gets the value of the `node` property.
    Property description:
      The node to display for this data item. You can either create your own node and set it on the data item before you add the item to the chart. Otherwise the chart will create a node for you that has the default representation for the chart type. This node will be set as soon as the data is added to the chart. You can then get it to add mouse listeners etc. Charts will do their best to position and size the node appropriately, for example on a Line or Scatter chart this node will be positioned centered on the data values position. For a bar chart this is positioned and resized as the bar for this data item.
    Returns:
      the value of the `node` property
    See Also:
      - `setNode(Node)`
      - `nodeProperty()`

  - ### setNode

    public final void setNode(Node value)
    Sets the value of the `node` property.
    Property description:
      The node to display for this data item. You can either create your own node and set it on the data item before you add the item to the chart. Otherwise the chart will create a node for you that has the default representation for the chart type. This node will be set as soon as the data is added to the chart. You can then get it to add mouse listeners etc. Charts will do their best to position and size the node appropriately, for example on a Line or Scatter chart this node will be positioned centered on the data values position. For a bar chart this is positioned and resized as the bar for this data item.
    Parameters:
      `value` - the value for the `node` property
    See Also:
      - `getNode()`
      - `nodeProperty()`

  - ### nodeProperty

    public final ObjectProperty<Node> nodeProperty()
    The node to display for this data item. You can either create your own node and set it on the data item before you add the item to the chart. Otherwise the chart will create a node for you that has the default representation for the chart type. This node will be set as soon as the data is added to the chart. You can then get it to add mouse listeners etc. Charts will do their best to position and size the node appropriately, for example on a Line or Scatter chart this node will be positioned centered on the data values position. For a bar chart this is positioned and resized as the bar for this data item.
    Returns:
      the `node` property
    See Also:
      - `getNode()`
      - `setNode(Node)`

  - ### toString

    public String toString()
    Returns a string representation of this `Data` object.
    Overrides:
      `toString` in class `Object`
    Returns:
      a string representation of this `Data` object.