Graphing a Result Set

You can use DB2 Web Query to graph numerical columns (columns where all values are numerical) from a result set, using the chart screen. You can create column charts, line graphs and pie charts. By default, each column is a group of data-points that are plotted as a set of columns of the same color, a line or a pie. If you plot more than one data column, columns of different colors, multiple lines, or nested pies will result.

You can use the defaults that DB2 Web Query supplies for many of the field choices in the task below, or you can modify them as appropriate for your environment. If you choose to use the defaults supplied by DB2 Web Query you can click Generate from the Chart screen without specifying any of the options mentioned in steps below.

To graph a result set:

1.         Open the Select Output window by clicking the result set that you want to open in the DB2 Web Query navigation pane and selecting open or by clicking Next from the Query Data Screen.

2.         Click the Chart button in the top right corner of the screen. The Chart screen opens.

Note:      At any point after this step you can click Generate to create your graph. The steps listed below allow you to customize your graph.

3.         From the Type list, select the type of graph that you want to create.

·          Select Column to create a column chart.

·          Select Pie to create a pie chart.

·          Select Line to create a line graph.

4.         From the Style list, select the style that you want to use in your graph. If you selected Column or Line from the Type list:

·          Select Normal to plot each group of data separately.

·          Select Stacked to add each group of data to the previous groups, resulting in a cumulative type graph.

·          Select Percent to plot each group as a percentage of the total of all groups.

If you selected Pie from the Type list, select:

·          Select Normal to plot a pie chart. Plotting multiple columns results in the creation of multiple pies that will be nested inside each other.

·          Select Extract to offset the first slice from the rest of the pie.

·          Select Exploded to separate all the slices from each other by moving them away from the center of the pie leaving space around each slice.

5.         From the Orientation list, select the way in which you want to group your data, by Columns or Rows. The default is columns. In column grouping, each row represents one line of data (or pie, or column set), and each column contains the data points within those groups. In column and line charts, data in any one group is drawn using the same color. In pie charts, data in a group is put into one pie and drawn using different colors for each slice.

6.         Check the Use the first column as row labels check box to have the first column that you specified used as column headings on your graph. This check box is only available if you have selected a non-numeric column as the first column to be graphed.

7.         Type a title for your graph in the Chart Title field.

8.         In the Chart Size field, indicate the chart size in pixels.

9.         Click the Axis button.

10.      Check the Display the X-axis check box to have the x-axis displayed.

11.      Type a label for the x-axis in the Label field.

12.      In the Grid Lines field, specify how far apart you want the grid lines to appear.

13.      In the Maximum field, type the maximum units on the scale that is on the x-axis on the graph.

14.      In the Minimum field, type the minimum units on the scale that is on the x-axis on the graph.

15.      Check the Display the Y-axis check box to have the y-axis displayed.

16.      Type a label for the y-axis in the Label field.

17.      In the Grid Lines field, specify how far apart you want the grid lines to appear.

18.      In the Maximum field, type the maximum units on the scale that is on the y-axis on the graph.

19.      In the Minimum field, type the minimum units on the scale that is on the y-axis on the graph.

20.      Click the Options button.

21.      In the Title section, select the font in which you want the title of the graph to appear, from the Font Face list.

22.      In the Title section, select the color in which you want your title to appear from the Font Color list.

23.      In the Background section, select the background color for your graph from the Color list.

24.      In the X-Axis section, select the font in which you want the labels on the x-axis of the graph to appear, from the Font Face list.

25.      In the X-Axis section, select the color in which you want the labels on the x-axis of the graph to appear from the Font Color list.

26.      In the Y-Axis section, select the font in which you want the labels on the y-axis of the graph to appear, from the Font Face list.

27.      In the Y-Axis section, select the color in which you want the labels on the y-axis of the graph to appear from the Font Color list.

28.      Click the Generate button. Your graph appears in a new browser window.