Vous êtes sur la page 1sur 18

1051

CHAPTER 46
Bar Charts
Introduction
General Purpose and Description
Bar charts are used to visually compare values to each other. There are several variations on the bar
chart. These include the vertical bar chart, horizontal bar chart, area chart, and line chart. There are
two and three dimensional versions of each. Below is an example of a 3D bar chart.
3D Bar Chart
B
u
s
h
e
l
s
Brand of Fruit Month
June
May
April
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
Data Structure
Data for a bar chart are entered in the standard row-column format of the spreadsheet. Each
numberic data value becomes a bar. Alphabetic data are used to label the rows and columns of the
chart. Below is an example of data ready to be charted. These data are stored in the FRUIT
database.
1052 Bar Charts
Table 46.1 - Fruit Data
Fruit April May June
Apple 82 70 20
Pear 73 50 33
Peach 67 45 28
Orange 85 65 17
Kiwi 54 42 24
Mellon 33 58 20
Procedure Options
This section describes the options available in this procedure. To find out more about using a
procedure, turn to the Procedures chapter.
Variables Tab
Specify the variables used to make a chart.
Data Variables
Select the variables to be charted. The data must be numeric, but can be positive or negative.
Negative values are displayed as bars going down instead of up.
Data Orientation
The orientation controls whether rows or variables are displayed across the horizontal axis. When
horizontal orientation is selected, the variables are displayed across the horizontal axis. When
vertical orientation is selected, each row is displayed separately across the horizontal axis.
Labels From First Row
When this option is on (set to Yes) and Data Orientation is set to Horizontal, the values in the first
row are used as labels. Otherwise, the variable names are used as labels. When Data Orientation is
set to Vertical, the value in the first row may be used in the chart title.
Label Variable
Specify an optional variable containing the labels for individual slices (Data Orientation = Vertical).
Chapter 46 Bar Charts 1053
Show Data Labels
This option controls the display of the Data Labels. Note that these labels are only displayed on 2D
charts. This option specifies whether labels are to be displayed above the bars.
No Yes
Bar Chart
April
May
June
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
Bar Chart
April
May
June
8
2
7
0
2
0
7
3
5
0
3
3
6
7
4
5
2
8
8
5
6
5
1
7
5
4
4
2
2
4
3
3
5
8
2
0
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
Chart Type
Select the type of chart you want. Possible choices are
Area
Stacked Area Chart
June
May
April
B
u
s
h
e
l
s
M
o
n
t
h
Brand of Fruit
0
50
100
150
200
Apple Peach Kiwi
Pear Orange Mellon
3D Area Chart
April
May
June
B
u
s
h
e
l
s
M
o
n
t
h
Brand of Fruit
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
Bar
Bar Chart
April
May
June
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
3D Bar Chart
April
May
June
B
u
s
h
e
l
s
M
o
n
t
h
Brand of Fruit
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
1054 Bar Charts
Line
2D Line Chart
April
May
June
B
u
s
h
e
l
s
M
o
n
t
h
Brand of Fruit
0
20
40
60
80
100
Apple Peach Kiwi
Pear Orange Mellon
Tape Chart
April
May
June
B
u
s
h
e
l
s
M
o
n
t
h
Brand of Fruit
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
Surface
Surface Chart
B
u
s
h
e
l
s
M
o
n
t
h
Brand of Fruit
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
Three Dimensional
Indicate whether you want the three-dimensional version of the chart.
Area Chart Style
This option is only used if Chart Type is set to Area. Possible styles are
Stacked
Area Chart
June
May
April
0
50
100
150
200
Apple Pear Peach Orange Kiwi Mellon
Area Chart
June
May
April
0
50
100
150
200
Apple
Pear
Peach
Orange
Kiwi
Mellon
Chapter 46 Bar Charts 1055
Absolute
Area Chart
April
May
June
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
Area Chart
April
May
June
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
Stacked Percentage
Area Chart
June
May
April
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
Area Chart
June
May
April
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
Bar Chart Style
This option is only used if Chart Type is set to Bar. Possible styles are
Bars
Bar Chart
April
May
June
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
Bar Chart
April
May
June
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
1056 Bar Charts
Stacked
Bar Chart
June
May
April
0
50
100
150
200
Apple Pear Peach Orange Kiwi Mellon
Bar Chart
June
May
April
0
50
100
150
200
Apple Pear Peach Orange Kiwi Mellon
Stacked Percentage
Bar Chart
June
May
April
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
Bar Chart
June
May
April
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
Z-Clustered (3D Only)
Bar Chart
April
May
June
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
Bar Orientation
Specify whether the bars are to be displayed vertically or horizontally.
Line Chart Style
This option is only used if Chart Type is set to Line. Possible styles are
Chapter 46 Bar Charts 1057
Lines Only Symbols
Line Chart
April
May
June
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
Line Chart
April
May
June
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
Sticks Sticks and Symbols
Line Chart
April
May
June
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
Line Chart
April
May
June
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
Lines and Symbols Lines and Sticks
Line Chart
April
May
June
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
Line Chart
April
May
June
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
Lines, Sticks, and Symbols Tape (3D Only - Any Style)
Line Chart
April
May
June
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
Line Chart
April
May
June
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
1058 Bar Charts
Surface Chart Style
This option is only used if Chart Type is set to Line. Possible styles are
Painted, Lines Lines
Surface Chart
B
u
s
h
e
l
s
M
o
n
t
h
Brand of Fruit
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
Surface Chart
B
u
s
h
e
l
s
M
o
n
t
h
Brand of Fruit
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
Painted Painted, Lines, Wall
Surface Chart
B
u
s
h
e
l
s
M
o
n
t
h
Brand of Fruit
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
Surface Chart
B
u
s
h
e
l
s
M
o
n
t
h
Brand of Fruit
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
Painted, Wall Lines, Wall
Surface Chart
B
u
s
h
e
l
s
M
o
n
t
h
Brand of Fruit
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
Surface Chart
B
u
s
h
e
l
s
M
o
n
t
h
Brand of Fruit
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
Edit Chart Interactively
Checking this option will cause the interactive graphics editor to be displayed. This allows you to
modify the graph interactively at run time. This editor is documented in the corresponding help file.
Once you are through editing the bar chart, it will be displayed in the output document.
Once the graphics editor comes up, you can use the scroll-bars on the four sides of the graph to
interactively rotate the chart to the viewing position and angle that you like the best.
Chapter 46 Bar Charts 1059
Filter Active
This option indicates whether the currently defined filter (if any) should be used when running this
procedure.
Titles Tab
These options control the titles that may be placed on all four sides of the chart.
Chart Title
This option gives the text that will appear in the title at the top of the chart. The color, font size, and
style of the text is controlled by the options to the right.
Bottom Title
This option gives the text that will appear in the title at the bottom of the chart. The color, font size,
and style of the text is controlled by the options to the right.
Left Title
This option gives the text that will appear in the title at the left of the chart. This may also serve as a
label. The color and orientation of the text is controlled by the options to the right.
Right Title
This option gives the text that will appear in the title at the right of the chart. This may also serve as
a label. The color and orientation of the text is controlled by the options to the right.
Variable Names
This option lets you select whether to display only variable names, variable labels, or both.
References Tab
This panel controls the color and size of the reference labels.
Text Color
This option sets the color of the reference items along the two axes.
Font Size
This option sets the font size of the reference items along the two axes.
Text Rotation
This option sets the display angle of the reference items along the horizontal axis.
Bold and Italics
This option sets the style of the reference items along the two axes.
Data Label Text Color
This is the color of the data labels displayed at the top of the bars.
Axes Tab
These options control the appearance and position of the axes.
1060 Bar Charts
Axis Position
This option sets the position of the vertical axis as either on the left or the right in 2D charts.
X Label Frequency
This option sets the label frequency of the horizontal axis. Setting this equal to 1 displays every
label. Setting this equal to 2 displays every other label.
X Tick Frequency
Specify the frequency of the X (horizontal) axis tick marks.
Scale Y Axis
This option specifies whether the vertical (Y) axis is scaled automatically (not checked) or from
user specified maximum, minimum, and number of tick marks (checked).
Y Minimum
Sets the value of the vertical minimum. This value may be negative. This value must be smaller
than the smallest data value. This value is only used when the User Defined Scale option is
checked.
Y Maximum
Sets the value of the vertical maximum. This value must be greater than the largest data value. This
value is only used when the User Defined Scale option is checked.
Y Axis Ticks
Sets the number of tick marks from the origin. This value is only used when the User Defined Scale
option is checked.
Grid Line Style
Specify the style (line, dots, dashes, etc.) of the grid lines.
Show X Ticks
Indicates whether to display tick marks along the X (horizontal) axis.
Show Y Ticks
Indicates whether to display tick marks along the Y (vertical) axis.
Show Minor Ticks
Specify whether to display the minor tick marks. This option works with 2D graphs only.
Thin Walls
Indicate whether the axis borders of 3D charts should be thick or thin.
Axis Color
Set the color of the axis lines.
Grid Color
Set the color of the grid lines.
Chapter 46 Bar Charts 1061
Cage Wall Color
Set the color of the cage wall in 3D charts.
Cage Edge Color
Set the color of the cage edge in 3D charts.
Show Vertical Grid
Specify whether to display the vertical grid lines.
Show Horizontal Grid
Specify whether to display the horizontal grid lines.
3D Options Tab
These options control the viewing position of the 3D charts. These options may be set interactively
by checking the Edit Chart Interactively option and then activating the four scroll bars on the sides
of the Graphics Editor window.
Perspective
This option specifies the perceived distance from which the graph is viewed. The range is from 0 to
100. As the value gets large, the distance gets smaller. A setting of 50 sets the viewing distance at
about twice the graphs width. A setting of 100 sets the viewing distance at about equal to the
graphs width.
Perspective = 10 Perspective = 90
3D Bar Chart
B
u
s
h
e
l
s
Brand of Fruit Month
June
May
April
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
3D Bar Chart
B
u
s
h
e
l
s
Brand of Fruit Month
June
May
April
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
1062 Bar Charts
Elevation
This option sets the vertical viewing angle (in degrees). The setting represents an angle above or
below a point halfway up the graph. The range is from -60 to 90.
Elevation = -20 Elevation = 50
3D Bar Chart
B
u
s
h
e
l
s
Brand of Fruit Month
0
20
40
60
80
100
June
May
April
Apple
Pear
Peach
Orange
Kiwi
Mellon
3D Bar Chart
B
u
s
h
e
l
s
Brand of Fruit Month
June
May
April
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
Rotation
This option sets the horizontal viewing angle (in degrees). The setting represents an angle around
the base of the graph. The range is from -180 to 180.
Rotation = -45 Rotation = 45
3D Bar Chart
B
u
s
h
e
l
s
Brand of Fruit Month
June
May
April
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
3D Bar Chart
B
u
s
h
e
l
s
Brand of Fruit Month
June
May
April
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
Depth
This option sets the width in the Z direction. The range is from 1 to 1,000.
Depth = 25 Depth = 400
3D Bar Chart
B
u
s
h
e
l
s
Brand of Fruit Month
June
May
April
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
3D Bar Chart
B
u
s
h
e
l
s
Brand of Fruit Month
June
May
April 0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
Chapter 46 Bar Charts 1063
Projection Method
This option specifies the method used to determine viewer position and angle in a 3D graph.
Off Perspective
3D Bar Chart
B
u
s
h
e
l
s
Brand of Fruit Month
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
3D Bar Chart
B
u
s
h
e
l
s
Brand of Fruit Month
June
May
April
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
Isometric
3D Bar Chart
B
u
s
h
e
l
s
Brand of Fruit Month
June
May
April
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
Gap Between Bars
This option specifies the gap between bars in the X (horizontal) direction in a 3D graph. The range
is from 0 to 95.
Gap = 19 Gap = 95
3D Bar Chart
B
u
s
h
e
l
s
Brandof Fruit Month
June
May
April
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
3D Bar Chart
B
u
s
h
e
l
s
Brand of Fruit Month
June
May
April
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
1064 Bar Charts
Gap Between Sets of Bars
This option specifies the gap between bars in the Z direction in a 3D graph. The range is from 0 to
95.
Gap = 19 Gap = 95
3D Bar Chart
B
u
s
h
e
l
s
Brand of Fruit Month
June
May
April
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
3D Bar Chart
B
u
s
h
e
l
s
Brandof Fruit Month
June
May
April
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
Surface Color Palette
Specify a color palette for the surface chart. The 128-color palettes may only be used on machines
with at least SuperVGA capabilities. Using a setting here of, for example, Black to Red will allow
the surface plot to show a continuous array of red hues from lowest to highest.
Surface Wall Color
Specifies the color of the border wall around the surface plot.
Surface Color Min
Specifies the number of the color to be associated with the lowest numerical value. Possible values
are 32 to 127. A value near 50 usually works well. Note that this option only works with 128-color
palettes.
Surface Color Max
Specifies the number of the color to be associated with the highest numerical value. Possible values
are 32 to 127. A value near 70 usually works well. Note that this option only works with 128-color
palettes.
Legend Tab
These options specify the legend.
Position
This option sets the position of the legend around the chart. Note that if you choose a position in
which the full text of the legend cannot be fit, the legend will not be displayed.
Percent Vertical
Specify the size of the legend as a percentage of the maximum possible. This option lets you shrink
a legend that is too large.
Text Color
Specify the color of the legend text.
Chapter 46 Bar Charts 1065
Background
Specify the background color of the legend.
Font Size
Specify the size of the legend text.
Bold and Italics
Specify the style of the legend text.
Back Style
Specify the background style of the legend.
Show Legend as Labels
This option only applies to 3D charts. Selecting Yes will disable the Legend and show the legend
labels along the z-axis. See below.
No Yes
3D Bar Chart
April
May
June
B
u
s
h
e
l
s
Brand of Fruit Month
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
3D Bar Chart
B
u
s
h
e
l
s
Brand of Fruit Month
June
May
April
0
20
40
60
80
100
Apple
Pear
Peach
Orange
Kiwi
Mellon
Color as Labels
Normally, text in the legend is displayed using the color selected by the Text Color option. This
option indicates that each legend entry is to be displayed in the corresponding group color.
Background Tab
These options specify the colors and background styles of various sections of the chart.
Entire Graph
Specify the background color and style of the entire chart.
Inside Graph
Specify the background color and style of the chart itself (within the axes).
Graph Title
Specify the background color and style of the chart title.
Left Title
Specify the background color and style of the left title.
1066 Bar Charts
Right Title
Specify the background color and style of the right title.
Bottom Title
Specify the background color and style of the bottom title.
Bars 1 and 2 Tabs
These options specify the colors and patterns used to display the bars.
Bar 1 - 15
These options let you specify the color and display pattern of the bars. The first bar is associated
with the first group (row or variable), the second bar with the second group, and so on. If more
than fifteen bars definitions are needed, they are reused so that group 16 = group 1, group 17 =
group 2, and so on.
Here is a bar chart that uses three different bar patterns:
Bar Chart
April
May
June
8
2
7
0
2
0
7
3
5
0
3
3
6
7
4
5
2
8
8
5
6
5
1
7
5
4
4
2
2
4
3
3
5
8
2
0
0
20
40
60
80
100
Apple Pear Peach Orange Kiwi Mellon
Template Tab
The options on this panel allow various sets of options to be loaded (File menu: Load Template) or
stored (File menu: Save Template). A template file contains all the settings for this procedure.
File Name
Designate the name of the template file either to be loaded or stored.
Template Files
A list of previously stored template files for this procedure.
Template Ids
A list of the Template Ids of the corresponding files. This id value is loaded in the box at the
bottom of the panel.
Tutorial
This section presents an example of how to create a bar chart of the data stored on the FRUIT
database.
To run this example, you can load the EXAMPLE1 template or take the following steps.
1 Open the FRUIT dataset.
Chapter 46 Bar Charts 1067
From the File menu of the NCSS Data window, select Open.
Select the Data subdirectory of the NCSS97 directory.
Click on the file Fruit.s0.
Click Open.
2 Open the Bar Chart window.
On the menus, select Graphics, then Charts, then Bar Chart. The Bar Chart procedure will
be displayed.
On the menus, select File, then New Template. This will fill the procedure with the default
template.
3 Specify the variables.
On the Bar Chart window, select the Variables tab.
Double-click in the Data Variables text box. This will bring up the variable selection
window.
Select April, May, June from the list of variables and then click Ok. April-June will
appear in the Data Variables box.
Double-click in the Label Variable text box. This will bring up the variable selection
window.
Select Fruit from the list of variables and then click Ok. Fruit will appear in the Label
Variable box.
4 Run the procedure.
From the Run menu, select Run Procedure. Alternatively, just click the Run button (the
left-most button on the button bar at the top).
1068 Bar Charts
Figure 46.1 Bar Plot
Bar Chart
Apple
Pear
Peach
Orange
Kiwi
Mellon
0
20
40
60
80
100
April May June

Vous aimerez peut-être aussi