A bar graph is a graph in which data is represented as a series of bars.
Use bar 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
Percentage or changes in percentage, such as how much revenue comes from each product line, or 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; 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 bar graphs are available:
Clustered bar graph -- Each cluster of bars represents a column of data, for easy comparison of the values in a column.
Stacked bar graph -- Bars 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 bar graph -- Bars are stacked and show 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 bar graph types.
Single Y-Axis |
Dual Y-Axis |
Split Dual Y-Axis |
---|---|---|
Clustered: |
Clustered: |
Clustered: |
Stacked: |
Stacked: |
Stacked: |
Percentage: |
NA |
NA |
The following properties of the Graph
object affect bar graphs:
MaxBarWidth
-- Specifies the maximum width of the bars in
the graph. Set this property to limit the width of the bars when the graph
displays a very small number of bars.
ColorMode
-- Specifies whether to use color to identify a
series. Set this property when you have only one series of data and you
want to display each bar in a different color.
DepthRadius
and DepthAngle
-- Together, these
properties specify whether the graph appears to have depth.
The following figure shows the data structure of a clustered bar graph.
The data structure for bar graphs is as follows:
A group is represented by a cluster or stack of bars and is labeled by an O1 tick label, such as Apr.
A series is represented by all the markers of the same color and is labeled by legend text, such as Americas.
Bar graph data has the following guidelines:
Graphs display numeric data only.
Percentage bar graphs cannot 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