8How to Create a Stacked Bar Chart

A stacked bar chart displays the results of multiple queries stacked on top of one another, either vertically or horizontally. Using a stacked bar chart is an effective way to present the absolute values of data points represented by the segments of each bar, as well as the total value represented by data points from each series stacked in a bar.

This tutorial describes how to create a Flash stacked bar chart. Before you begin, you need to import and install the OEHR Sample Objects application in order to access the necessary sample database objects. See "About Loading Sample Objects".

Schema - Select the schema where you installed the OEHR sample objects.

Click Next.

Next, you need to add a page. You have the option of adding a blank page, a report, a form, a tabular form, or a report and form. For this exercise, you add a blank page.

Add a blank page:

Under Select Page Type, select Blank and click Add Page.

The new page appears in the list at the top of the page.

Click Next.

For Tabs, accept the default, One Level of Tabs, and click Next.

For Copy Shared Components from Another Application, accept the default, No, and click Next.

For Attributes, accept the defaults for Authentication Scheme, Language, and User Language Preference Derived From and click Next.

For User Interface, select Theme 2 and click Next.

Review your selections and click Create.

The Application home page appears.

Creating a New Page

To create your chart, you can either add a region to an existing page and define it as a stacked bar chart, or you can create a new page. In this exercise, you create a new page within the Bar Chart application you just created.

The chart will display the sum for sales by product category. It will contain sales for the twelve months prior to the current month. In the following exercise, you use a wizard to create the chart and the first query. Then, you add additional queries (or series) for other product categories to make it stacked.

The value label (in this instance, Office Equipment) is displayed in the legend of stacked charts.

For When No Data Found Message, enter:

No orders found in the past 12 months.

Scroll up to the top of the page and click Apply Changes.

Updating the Sample Data

The sample data that installed with the OEHR Sample Objects application is not current. To make the data current, you need to update the dates in the sample data. You will accomplish this by running an update statement in SQL Commands

The chart displays the revenue for each product category by month. A legend that defines the color associated with each product appears at the top of the page. Note that the text in X Axis is spaced too closely together. In the next section, you edit the chart attributes to correct this issue.

Editing Chart Attributes

In this exercise, you change the appearance of your chart by editing chart attributes.