A pie graph is a graph in which data is represented as sections of one or more circles, making the circles look like sliced pies.
Use pie graphs to show the following aspects of data:
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 in 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 varieties of pie graphs are available:
Pie graph -- The center of each pie is full.
Ring graph -- The center of the pie has a hole, in which the total pie value is displayed.
The following table shows the arrangements that are available for the different pie graph types.
Single Pie or Ring |
Multiple Pie or Ring |
---|---|
Single pie: |
Multiple pie: |
Single ring: |
Multiple ring: |
The following properties of the Graph
object affect line graphs:
PieRotation
-- Specifies where the slice for the first series
appears.
The DepthRadius
and DepthAngle
properties of
the Graph
object together specify whether an area graph appears
to have depth.
The following figure shows the data structure of multiple pie graph.
The data structure of a pie graph is as follows:
A group is represented by one pie or ring and is labeled by a pie label, such as Feb.
A series is represented by all slices of the same color, and it is labeled by legend text, such as Asia.
If you have only one group of data, then only one pie appears on the graph, even if you select a multiple pie graph type.
If any group has all zero or NA data, then that pie does not appear on the graph; in a single pie graph, if the first group of data has all zero or NA data, then the graph is blank.
In a single pie graph, the first group of data is represented in the pie. To show data for
another group instead, call Graph.setStartCol
(or Graph.setStartRow
,
if isDataRowShownAsASeries
returns false
) to the number of the group
that you would like to display.
Pie graph data has the following guidelines:
Graphs display numeric data only.
Pie graphs cannot have negative numbers. If you pass negative numbers to
a pie 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
.
Multiple-pie graphs require at least two groups of data. If you pass only
one group, then the graph displays only one pie. If you pass more than one
group, but a group does not have data for each series, then the graph issues
an AlertEvent
.
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