About XY (Scatter) Charts


XY (Scatter) charts plot two groups of numbers as one series of XY coordinates. XY charts show the relatedness of two sets of data. If the data points cluster or bunch in a certain configuration -- for example, if they tend to form the shape of a line -- that indicates that the two sets of data are correlated in some way.

Each marker represents a data point. Each data point must have two pieces of data related to it: its X coordinate and its Y coordinate.

XY charts can have more than one series. Data points in one series all have the same marker style. By default, Formula One for Java connects the markers in a series with a line.

XY charts should be used when you want to compare two sets of values for each series. If one of the two sets of data falls into categories in which you have one entry per category (for example, a statistic that happens every year or for every age group), that data is better served appearing as categories on a different type of chart.

Creating XY Charts

Because the data for XY charts can be arranged in various configurations, Formula One for Java cannot create XY charts automatically. It needs user input to define how the data should be used. To create an XY chart, you first create a "mock" chart using a sample data range. Then you bring up the Chart Data tab to redefine how the data should be used in the chart.

To create an XY chart:

  1. Set up the worksheet so that there are two sets of values for each data point (the X axis value and the Y axis value). You can set up your data range in any arrangement, even with non-contiguous cells. This is how the worksheet was set up for the example chart.


  2. To create the chart, select the cells in the chart's data range. (Since you will later define which cells should represent which areas, it doesn't matter which cells you select.) Click on the Chart button and draw the chart onto the worksheet. For more information, see Creating a Chart.
  3. Change the chart type to XY (Scatter), as explained in Changing the Chart Type.
    The chart that appears will probably look odd, but you will fix it in the next steps.
  4. CTRL + click on the chart to select it, then choose Format > Object. The Chart Data tab of the Format Object dialog will appear.
  5. For an XY chart like the one in the example, which has only one series, delete all but one series by selecting unwanted series and clicking the Delete button.
  6. Select a series. Fill in the Name text box with the name you want to appear for this series on the chart legend. You can enter the text of the name or a cell reference pointing to the cell that contains the name.
    Fill in the X Values and Y Values text boxes with range references that refer to the appropriate ranges on the worksheet. (These range references should include only numeric data, not heading or other text cells.)
    For more information about options for filling in the Chart Data tab, see Changing the Chart's Data Source.
    Here is how the Chart Data tab was filled in for the example chart.


  7. For an XY chart with more than one series, repeat step 6 for each series on the chart.
  8. Click Apply to view your changes or OK to accept your changes.
  9. Finish formatting the chart using the context menu options.

Special Notes About XY Charts

Line connecting the markers. By default, XY charts are drawn with a line connecting all of the markers in a series. You can remove the line by selecting the series of data points, choosing Format Series from the context menu, and clicking Transparent on the Line Style tab. For more information, see Changing Line Styles and Colors.

Labeling the data points. You may label one or all of the data points in a series with automatic data labels that show either the X or Y values or with custom data labels you enter yourself. To label the data points with the X values, choose Category on the Data Labels tab. Strictly speaking, the X axis in this case is a value axis, not a category axis, but the Data Labels tab does not reflect this distinction. For more information, see About Data Labels.