Published year: 1997
A display is the basic modular unit for Oracle Graphics. Within a display, a chart or set of charts comprises the functional module that makes up an Oracle Graphics application unit.
A pie chart presents data from several sources to indicate the portion that each contributes to the total for all sources. As shown in Figure 37.4, the warehouse shipments chart shows the relative percentage of shipments for a single warehouse for a single year.
The warehouse shipments pie chart.
You can create a new chart in Oracle Graphics using either a one-step or two-step method. To use the one-step method, first click the mouse within the Layout Editor canvas to activate the editor and then select Chart Create Chart from the menu. A query dialog box appears that enables you to name and create a new query to select data for the pie chart. Using this box, create the query, Q_performance, as shown in Figure 37.5.
In addition to creating an Oracle Graphics chart using an embedded query, you can use data from external programs such as Microsoft Excel (SYLK file format) or Lotus 1-2-3 (WKS file format), as well as from a .PRN output file. Also, you can use an Oracle SELECT statement stored in an operating-system external SQL file to retrieve data for your chart.
Creating a new chart query.
After you create the query, you can test it by clicking the Execute button at the bottom of the dialog box. (Note that you can use the Connect button to connect to the database if you have not yet done so.) The results of the query are shown in the second tab of the New Query dialog box. When you are satisfied with the query, click OK to view the Chart Properties dialog box.
You use the Chart Properties dialog box (shown in Figure 37.6) to define how the data from the query is laid out on the presentation canvas. To create the pie chart, enter the chart name and title as shown. Define the format for the chart by selecting the type and subtype icon for the chart you want. For this chart, first select the pie chart type (second row, left) and then select the pie chart with depth subtype (far right). The format you select is stored as a template that you can name within the display for any additional charts that might be needed. (The default is template#.)
The Chart Properties sheet.
After the chart layout is completed, click OK to display the chart on the Layout Editor canvas. (You might have to drag the chart from the edge of the canvas to view the entire chart.) At this point, you can save the chart to the file system (or database) by selecting File Save As from the menu. Save this chart as g38oun01.odg.
A columnar chart displays related data in a series of vertical filled bars. As shown in Figure 37.7, the monthly shipments chart displays the number of orders shipped each month for a warehouse.
The monthly shipments columnar chart.
To create this chart using the two-step method, click the mouse within the Object Navigator and select the Queries category. Using the iconic buttons at the left of the Object Navigator, click the Add Object icon to create a new query. In the first tab of the Query Properties dialog box, define the new query with the name Q_mly_ships:
select to_char ( to_date (to_char (hist_month_no), `MM'), `MON'), hist_ord_shipped from warehouse_history where hist_year = 1994 and hist_wh_code = `WNJ' order by hist_month_no
To build the columnar chart, activate the Layout Editor and select the Chart tool from the Graphics tool palette. Using this tool, drag a region for the chart on the layout canvas. This action causes the Chart Genie dialog box to appear, enabling you to define the data source for the new chart, as shown in Figure 37.8. For this example, select the Existing Query radio button and choose the query Q_mly_ships that was previously defined.
Assigning a query for a new chart.
Define the layout for the chart using the Chart Properties dialog box as shown by selecting the Columnar Chart type (top row, left) and the Columnar Chart with Shadow subtype (top row, right). When you are satisfied with the chart, save it as g38oun02.ogd.
Oracle Graphics 2.5 provides the functionality to create ten types of charts, with further subtype delineation, to define a total of 56 chart formats. The first chart type is the column chart that was shown in the previous section. In its most basic form, a simple column chart consists of a series of filled rectangles indicating a value based on the height of the bar. Oracle Graphics has variations of the columnar chart for charts that present data that can be grouped in
. (An example is the shipments for all warehouses for each month.) These variances
include columns with stacked bars (the individual bars are stacked on top of each other to indicate the totals for the category), columns with overlapping bars (the individual bars overlap within the group ), and columns with percent scaling (each segment shows the percentage that each bar contributes to the total 100 percent).
The column with a baseline at zero is a chart subtype for negative data values. A column chart with shadows displays the bars in a three-dimensional background; the bar shadow shows
behind the bars. A column chart with depth presents each bar as a 3D object in a multi-
dimensional background. The last column chart subtype, column with connecting lines, displays the bars with a solid line connecting the tops of each bar.
The next chart type is the bar chart. This chart displays the data in a series of horizontal bars. The same variations are available for the bar chart as in the case of the column chart.
The next set of chart formats is the line chart and its variations. These chart subtypes can be classified in three major subcategories.
Within each of these subcategories, you can choose to show symbols at each data point. You also can show multiple data entities as additive values on the same chart as individual stacked lines or as stacked lines with a solid fill between the line and the horizontal axis or prior line.
Published year: 1997