Object Reference : Graph Creation Commands
  
 
pie
Display a pie chart view.
In the default setting, there will be one pie for each date or observation number. Each series or column of data is shown as a wedge in a different color/pattern, where the width of the wedge equals the percentage contribution of the series or column to the total of all listed series or columns. Negative and missing values are treated as zeros.
Syntax
pie(options) o1 o2 [o3 ... ]
object_name.pie(options) [categorical_spec(arg)]
where o1, o2, ..., are series or group objects. You may specify general graph characteristics by including options following the pie keyword.
The optional categorical_spec allows you to specify a categorical graph (see “Categorical Spec”).
Options
Template and printing options
 
o=template
Use appearance options from the specified template. template may be a predefined template keyword (“default” - current global defaults, “classic”, “modern”, “reverse”, “midnight”, “spartan”, “monochrome”) or a graph in the workfile.
t=graph_name
Use appearance options and copy text and shading from the specified graph.
b / -b
[Apply / Remove] bold modifiers of the base template style specified using the “o=” option above.
w / -w
[Apply / Remove] wide modifiers of the base template style specified using the “o=” option above.
reset
Resets all graph options to the global defaults. May be used to remove existing customization of the graph.
p
Print the graph.
The options which support the “–” may be preceded by a “+” or “–” indicating whether to turn on or off the option. The “+” is optional.
Graph data options
The following option is available in non-panel or categorical graph settings:
 
contract=key
Contract the data as specified by key, where key may be: “mean”, “median”, “max”, “min”, “sum”, “var” - variance, “sd” - standard deviation, “sumsq” - sum of the squared values, “skew” - skewness, “kurt” - kurtosis, “nas” - number of missing values, “obs” - number of observations, “unique” - error if the series is not identical for all observations in a given group, “first” - first observation in category using workfile order, “last” - last observation in category using workfile order, “quant(quantile)” - where quantile is a number between 0 and 1.
Panel options
The following option applies when graphing panel structured data.
 
panel=arg (default taken from global settings)
Panel data display: “stack” (stack the cross-sections), “individual” or “i” (separate graph for each cross-section), “combine” or “c” (combine cross-section graphs in a single frame), “mean” (plot means across cross-sections), “median” (plot median across cross-sections).
(Note: more general versions of these panel graphs may be constructed as categorical graphs.)
Examples
Basic examples
pie const inv gov
displays pie charts for each period, each showing the relative sizes of CONS, INV, and GOV.
group g1 cons inv gov
g1.pie
displays the equivalent pie graph of the data in G1.
g1.pie(o=midnight, b, w)
displays the pie graph using the settings of the predefined template “midnight”, applying the bold and wide modifiers.
g1.pie(contract=mean)
displays a single pie graph with slices depicting the mean values for each series.
Panel examples
g1.pie(panel=individual)
displays pie graphs using the series in G1 with each cross-section displayed in a separate frame, while,
g1.pie(panel=mean)
displays a single pie graph showing, for each period, the pie graph formed using the means of the series computed across cross-sections.
Categorical examples
g1.pie(contract=mean) within(id)
constructs three pie graphs, one each for CONS, INV, and GOV, where the slices are determined by the relative sizes of the means of the respective series for each value of ID. There will be 10 slices for each pie.
g1.pie(contract=sum) within(id) within(@series)
displays a single pie graph with slices formed by the relative sizes of the sums of the series for each ID. If there are 10 distinct values of ID, the pie will have 30 slices.
for each value of ID using the sums of values of the series in the group G1 to determine the size of the pie slices. Each pie graph will be displayed in a separate frame. Alternately,
g1.pie(contract=mean) across(id) within(@series)
constructs one pie graph for each cross-section, where the slices are given by the mean values of CONS, INV, and GOV for the cross-section.
Cross-references
See “Graphing Data” for a detailed discussion of graphs in EViews, and “Templates” for a discussion of graph templates.
See Graph::graph for graph declaration and other graph types.