Bar Graphs

Contributed by:
NEO
This pdf includes the following topics:-
Data Structure
Bar Chart Window Options
Bar Chart Tab
Plot Type Section
Connecting Lines Section
Two Factors
Data Values Section
Layout Tab
1. NCSS Statistical Software NCSS.com
Chapter 141
Bar Charts
Bar charts are used to visually compare values to each other. This chapter gives a brief overview and examples of
simple bar charts and two-factor bar charts. The orientation of a bar chart may be vertical or horizontal. Below is
an example of a vertical bar chart with two factors (fruit and month).
Data Structure
Data for a bar chart are entered in columns. Each numeric data value becomes a bar. The simple bar chart
procedure gives a bar chart for each column of data. The two-factor bar chart combines columns of data into a
single chart. Below is an example of data ready to be charted. These data are stored in the Fruit dataset.
Fruit dataset
Fruit April May June Total
Apple 82 70 20 172
Pear 73 50 33 156
Peach 67 45 28 140
Orange 85 65 17 167
Kiwi 54 42 24 120
Melon 33 58 20 111
141-1
© NCSS, LLC. All Rights Reserved.
2. NCSS Statistical Software NCSS.com
Bar Charts
Bar Chart Window Options
This section describes the specific options available on the Bar Chart window, which is displayed when the Bar
Chart button is clicked. Common options, such as axes, labels, legends, and titles are documented in the Graphics
Components chapter.
Bar Chart Tab
Plot Type Section
You can create a chart that displays either bars or symbols using the options in this section.
One Factor
Two Factors
141-2
© NCSS, LLC. All Rights Reserved.
3. NCSS Statistical Software NCSS.com
Bar Charts
Bars or Symbols Section
You can specify the format of either the bars or symbols using the options in this section.
One Factor
Two Factors
Connecting Lines Section
You can add connecting lines either between or within groups using the options in this section.
One Factor
141-3
© NCSS, LLC. All Rights Reserved.
4. NCSS Statistical Software NCSS.com
Bar Charts
Two Factors
Reference Line Section
The Reference Line is the line from which the bars are drawn. You can specify the value from which the bars
originate using the options in this section.
Data Values Section
You can add data values above the bars using the options in this section.
141-4
© NCSS, LLC. All Rights Reserved.
5. NCSS Statistical Software NCSS.com
Bar Charts
Layout Tab
Orientation Section
You can orient the chart vertically or horizontally.
Object Spacing and Size Section
You can change the size of the gap between individual bars.
Titles, Legend, Numeric Axis, Group Axis, Grid Lines, and Background
Details on setting the options in these tabs are given in the Graphics Components chapter.
141-5
© NCSS, LLC. All Rights Reserved.
6. NCSS Statistical Software NCSS.com
Bar Charts
Example 1 – Creating a Simple Bar Chart
This section presents an example of how to create a bar chart of the data stored in the Fruit dataset.
To run this example, complete the following steps:
1 Open the Fruit example dataset
• From the File menu of the NCSS Data window, select Open Example Data.
• Select Fruit and click OK.
2 Specify the Bar Charts procedure options
• Find and open the Bar Charts procedure using the menus or the Procedure Navigator.
• The settings for this example are listed below and are stored in the Example 1 settings template. To load
this template, click Open Example Template in the Help Center or File menu.
Option Value
Variables Tab
Data Variables ........................................ Total
Label Variable ......................................... Fruit
Report Options (in the Toolbar)
Variable Labels ....................................... Column Labels
3 Run the procedure
• Click the Run button to perform the calculations and generate the output.
141-6
© NCSS, LLC. All Rights Reserved.
7. NCSS Statistical Software NCSS.com
Bar Charts
Bar Chart Output
Bar Chart Report ────────────────────────────────────────────────────────────
You could make all the bars the same color by clicking on the Bar Chart Format button. There you would click on
the Bar Fill format button and change the Fill Mode from Multiple Fills to Single Fill. The result is shown below.
Bar Chart Report ────────────────────────────────────────────────────────────
141-7
© NCSS, LLC. All Rights Reserved.
8. NCSS Statistical Software NCSS.com
Bar Charts
Example 2 – Creating a Two-Factor Bar Chart
This section presents an example of how to create a two-factor bar chart of the data stored in the Fruit dataset.
To run this example, complete the following steps:
1 Open the Fruit example dataset
• From the File menu of the NCSS Data window, select Open Example Data.
• Select Fruit and click OK.
2 Specify the Bar Charts (2 Factors) procedure options
• Find and open the Bar Charts (2 Factors) procedure using the menus or the Procedure Navigator.
• The settings for this example are listed below and are stored in the Example 2 settings template. To load
this template, click Open Example Template in the Help Center or File menu.
Option Value
Variables Tab
Data Variables ........................................ April-June
Label Variable ......................................... Fruit
Data Orientation...................................... Horizontal: Columns as Groups (Axis), Rows as Subgroups
(Legend)
Bar Chart Format (Click the Button)
Numeric Axis Tab
Lower Axis Label ................................. Number Sold
Group Axis Tab
Lower Axis Label ................................. Month
3 Run the procedure
• Click the Run button to perform the calculations and generate the output.
141-8
© NCSS, LLC. All Rights Reserved.
9. NCSS Statistical Software NCSS.com
Bar Charts
Bar Chart Output
Bar Chart Report ────────────────────────────────────────────────────────────
You can switch the factors by changing the Data Orientation to Vertical, changing the Group Axis Label to
Fruit, and changing the Legend Title to Month (Example 2b settings template). The result is shown below.
Bar Chart Report ────────────────────────────────────────────────────────────
141-9
© NCSS, LLC. All Rights Reserved.