|
Like the Column, the Bar chart is used to compare values of the same category on a common scale. This time, the chart is drawn
horizontally. You create a Bar chart using the same process as the Column,
except that you should select the Bar in the second page of the wizard.
In the following chart, we will see the frequent number of scoops that customers
order.
 |
In the following exercise, we are referring to an issue that
has not been introduced previously. The reason is that we are going to
ask you to use a function that cannot be explained at this time. The
function we want you to use is called Choose(). We will explain it
when we get to the functions and expressions. The problem is that, the
chart we want to create is completely based on numbers from the Scoops
column. If we just use the number, Microsoft Access "thinks"
that we want to use a sum of the scoops and create a chart from it.
Instead, we want to get a sum of scoops by categories. That is, we want to
know the number of 1 scoop, or the number of 2 scoops, or the number of 3
scoops.
Therefore, in our own defense, here is what we propose to you. Since the
following exercise is for demonstration purposes, you can skip it and you
will not loose anything. Otherwise, simply do the exercise and trust us as
you have done so far. |
|
Practical Learning: Creating a Bar Chart
|
|
-
To create a new query, on the main menu, click Insert
-> Query and, in the New Query dialog box, double-click Design View
-
In the Show Table dialog box, double-click
CustomersOrders and click Close
-
In the CustomersOrders list, double-click Scoops and
press Tab. That will put the caret in the second column
-
In the second column, type
NumberOfScoops: Choose([Scoops], "One", "Two",
"Three")
and press Enter
Save the query as TypesOfScoops
-
Switch the query to Datasheet View to preview it. Then
close it
-
To create a new chart, on the main menu, click Insert
-> Form
-
In the New Form dialog box, click Chart Wizard
and, in the bottom combo box, select TypesOfScoops and click OK
-
In the first page of the Chart Wizard, in the Available
Fields list, double-click NumberOfScoops to include it in the Fields For
Chart list:
-
Click Next
-
In the second page of the Chart Wizard, click the chart
in the 1st column - 2nd row Bar Chart
-
Click Next twice
-
Set the Title to Number of Scoops/Order and click
Finish
-
Save the form as chtNumberOfScoopsPerOrder
-
After viewing the chart, print then close the form
|
|