A scatter graph is a graph in which data is represented by the location of data markers.
You use scatter graphs to show correlations between:
Two different measures
Two dimension members in the same measure
Scatter graphs are especially useful when you have a number of data items and you want to see the general relationships.
You could use a scatter graph to plot the length of commute and absenteeism for your work force.
If there is a strong correlation between length of commute and frequency of absence, most of the data markers will fall along a diagonal line from the lower-left to the upper-right corner. If not, data markers will not fall into this pattern.
The following types of scatter graphs are available:
SCATTER
-- Has one Y-axis.
SCATTER_2Y
-- Has two Y-axes.
The following properties of the Graph
object affect scatter graphs:
ScatterDataLineDisplayed
-- Specifies whether the lines appear
in the scatter graph.
DepthRadius
and DepthAngle
-- Together, these
properties specify whether the graph appears to have depth.
The following figure shows the data structure of a scatter graph. This graph is a single-Y scatter graph, populated with the Promotional Expense and Sales measures (in that order).
The data structure for scatter graphs is as follows:
A group is a two-column set or, if data columns are shown as series, then a two-row set of data. A group is represented by data markers for the same dimension member (such as Eastern region). Groups are hard to identify in a scatter graph, but it is not as important to identify groups. You generally are looking more for the overall pattern of the data markers. Groups are labeled by marker text, which is not visible by default.
A Series are represented by all the markers of the same color and is labeled by legend text, such as VHS Camcorder.
Each data marker in a scatter graph represents two values:
The first measure value is the X value. It determines the marker's location along the X-axis.
The second measure value is the Y value. It determines the marker's location along the Y-axis.
Scatter graph data has the following guidelines:
Graphs display numeric data only.
Scatter graphs require at least two columns of data (or two rows, if columns represent series). If you pass only one column (or row) of data, then the Graph bean displays a message about insufficient data, instead of displaying a graph.
For more than one group of data, the data must be in multiples of two,
such as two columns or rows for Tokyo, three for Paris, and so on. If the
last group does not have two columns (or rows), then the graph does not
display that group. The graph notifies any registered AlertListeners
of this problem by sending an AlertEvent
, with DATA_PARTIAL_GROUP
as its ID.
The following scatter graph is populated with the Sales and Usability expense measures, in that order. For simplicity in this example, each series of data has only one marker in it. Normally, scatter graphs have a number of markers.
The following crosstab shows the same data as the graph. Notice that there are two columns of
data for each marker in the graph. This picture assumes that
isDataRowShownAsASeries
returns true
.
Handling Problems
in Graph Data
Specifying Data for a Graph
Example: Setting JDBC Data on
a Scatter Graph
Example: Setting Data from a
File on a Scatter Graph