A line graph is a graph in which data is represented as a line, as a series of data points, or as data points that are connected by a line.
Use line graphs to show the following aspects of data:
Trends over time, such as sales for the last 12 months.
Comparisons of items at the same time, such as sales for different product divisions in several regions
Rate of data change, such as how fast the market share is increasing
Percentage, such as how much revenue comes from each product line
Changes in percentage, such as whether last year's big seller provides the same percentage of revenue as it did last year at this time
Relationship of parts to the whole, such as which products' sales are most closely related to total sales, or which products' sales follow the trend of total sales
Changes in all parts of a whole, such as the rate of revenue growth for all products in the fastest growing division
The following types of line graphs are available:
Absolute line graph -- Each data marker reflects the data values in the column.
Stacked line graph -- Lines are "stacked": the values of each series are added to the values for previous series. The size of the stack represents a cumulative total.
Percentage line graph -- Lines are stacked, and each line shows the series percentage of the cumulative total of all series.
These types can also have the following axis arrangements:
Single Y-axis -- Uses a single Y-axis.
Dual Y-axis -- Uses two Y-axes that can have different scales.
Split dual Y-axis -- Splits the plot area into two graphs with independently scaled Y-axes.
The following table shows which of the axis arrangements are available for the different line graph types.
Single Y-Axis |
Dual Y-Axis |
Split Dual Y-Axis |
---|---|---|
Absolute: |
Absolute: |
Absolute: |
Stacked: |
Stacked: |
Stacked: |
Percentage: |
NA |
NA |
The following properties of the Graph
object affect line graphs:
MarkerDisplayed
-- Specifies whether markers appear along
the lines in the line graph.
LineDataLineDisplayed
-- Specifies whether the lines appear
in the line graph.
DepthRadius
and DepthAngle
-- Together, these
properties specify whether the graph appears to have depth.
Note: Do not set both MakerDisplayed
and LineDataLineDisplayed
to false
. If you do, then the graph does not have any way to display
data.
The following figure shows the data structure of an absolute line graph.
The data structure for line graphs is as follows:
A group is represented by a marker of each color, aligned with the O1 tick label. It is labeled by an O1 tick label, such as Mar
A series is represented by a line and is labeled by legend text, such as Americas
Line graph data has the following guidelines:
Graphs display numeric data only.
Line graphs require at least two groups of data, because a line requires at least two points. If you pass only one column of data, then the Graph bean displays a message about insufficient data, instead of displaying a graph.
Percentage line graphs should not have negative numbers. If you pass negative
numbers to a percentage graph, then the graph sends an AlertEvent
to any AlertListeners
that have been registered. The ID of
the alert event is either DATA_ALL_DATA_NULL_NEG_ZERO
or DATA_PARTIAL_DATA_NULL_NEG_ZERO
.
Time axis data must be regular, complete, and in ascending order. If it is not, then the graph displays a regular ordinal axis rather than a time axis.
Handling Problems
in Graph Data
Specifying Data for a Graph
Example: Setting JDBC Data on
a Simple Graph
Example: Setting Data from a
File on a Simple Graph