Creating a Chart in Excel

Suppose you'd like some of the same information in a more graphical format. Excel provides a nice tool for graphs with a somewhat easier-to-use interface than Access. Here's how you can create a pie chart showing the number of cases currently assigned to each status.

First, fire up Excel. Then select Data >■ Import External Data >■ New Database Query. This will install Microsoft Query if necessary (it's not part of the default Excel installation) and then open the Choose Data Source dialog box. Select New Data Source and click OK. Name the data source and select the appropriate driver (Access or SQL Server), then connect to the database. Click OK to save the data source, then select it and click OK again. This will open the Query Wizard.

On the Choose Columns panel of the Query Wizard, expand the Bugs table and select the ixBug column. Then expand the Status table and select the sStatus column. Click Next twice, then click Finish to edit the query in Microsoft Query. Click the SQL toolbar button and modify the SQL statement:

SELECT Status.sStatus, Count(Bug.ixBug) FROM Bug, Status

WHERE Bug.ixStatus = Status.ixStatus GROUP BY Status.sStatus

Select Return Data to Microsoft Excel from the File menu. This will open the Import Data dialog box. You can now select where in the workbook to place the data; I chose to put it in the default $A$1 location.

After a moment, Excel will retrieve the data from FogBugz. Select the retrieved data and click the Chart Wizard button on the Excel toolbar. Select a chart type such as the 3D pie chart and click Finish to create the chart. Figure 4-20 shows a sample result.

Figure 4-2D. Excel chart based on FogBugz data
0 0

Post a comment