Data Requirements for Different Kinds of Graphs

All graphs display numeric data only; do not pass dates or strings as the data that the graph displays. Other requirements of graph data differ, according to the type of the graph. You can set up callbacks and listeners to deal with messages about data problems.

Geometry requirements

Some graph types need a certain number of data points in order to display data. For example, a line graph requires at least two groups of data, because a line requires at least two points. Likewise, an area graph also requires two groups of data. A three-dimensional surface graph requires at least two series and two groups, so that it can draw a surface.

If the data that you pass to a graph does not have enough rows or columns to display the specified graph type, then the Graph bean does not display a graph. Instead, it displays a message about insufficient data.

Complex graph types

Some graph types require more than one data point for each marker. A scatter graph, for example, needs two values for each group, so that it can position the marker along the X-axis and along the Y-axis. A bubble graph needs three values for each group: an X-value, a Y-value, and a Z-value, which determines the size of the marker.

Stock graphs all require multiple data values for each group. An open-close stock graph requires two values for each group, so that it can determine the size and location of the marker. An open-high-low-close stock graph requires four values for each group. Stock graphs that show volume need an added value in the group to show the volume.

If the data that you pass does not have enough data points for each group, the Graph bean does its best to display a graph. It sends an AlertEvent to any registered AlertListener objects, though, to let you know that not all of the data is displayed.

Logic requirements

Some data requirements have to do with logic. For example, you should not pass negative data to a pie graph or to a percentage bar, line, or area graph. If you do, then the Graph bean sends an AlertEvent to registered AlertListener objects. It does not display markers for negative data in percentage graphs.

The graph also does not display markers for null or zero values. It sends an AlertEvent instead.

In a dual-Y graph, if you pass only one series of data, then the graph cannot display data on two different axes. It displays the data on a single axis.

Requirements for a time axis

Data that you display on a time axis in a vertical bar, line, area, combination, or stock graph must meet the following requirements:

If the data does not meet these requirements, then the graph does not treat the axis as a time axis. Instead, it converts all of the labels to strings.

Specific guidelines for each graph type

Guidelines for specific graph types appear in topics that describe the graph type. The following hyperlinks go directly to the data guidelines:

Data guidelines for area graphs

Data guidelines for bar graphs

Data guidelines for line graphs

Data guidelines for radar graphs

Data guidelines for dual-Y graphs

Data guidelines for pareto graphs

Data guidelines for pie graphs

Data guidelines for pie-bar graphs

Data guidelines for three-dimensional graphs

Data guidelines for scatter graphs

Data guidelines for polar graphs

Data guidelines for bubble graphs

Data guidelines for high-low-close stock graphs

Data guidelines for high-low-close stock graphs with volume

Data guidelines for open-high-low-close stock graphs

Data guidelines for open-high-low-close stock graphs with volume

Data guidelines for open-close candle stock graphs

Data guidelines for open-close candle stock graphs with volume

Data guidelines for open-high-low-close candle stock graphs

Data guidelines for open-high-low-close candle stock graphs with volume