Example 4: Charting related records
This example is based on the membership database of a fictitious travel firm, The Corporate Travelers Club. Use the FileMaker Pro tutorial sample file, Sample.fp7, to create this chart. The sample file is located in:
FileMaker Pro 11/English Extras/Tutorial
or
FileMaker Pro 11 Advanced/English Extras/Tutorial
About the chart
In this example, you will create a bar chart that displays membership fees collected by each company. You will place the chart on the Companies layout, which contains address information for each company in a separate record. When you are finished, your chart will update to show member data for each company as you browse through the three company records.
Save a copy of the sample file
1.
2.
You see the sample file’s Data Entry layout. It displays one record in Form View.
Create a relationship between the two tables in the database
Create a relationship between the Members and Companies tables.
1.
Choose File menu > Manage > Database.
2.
Click the Relationships tab.
You see the relationships graph. The relationships graph shows all the tables in the current file.
When you create a relationship between two tables, you make the data stored in either table accessible to the other table.
3.
In the Members table, click the Company field and drag a line to the Company field in the Companies table, then release the mouse button.
You see the relationship you have created. The relationship is based on matching data in the Company field in both tables. Records are related when data in the Company field in one table matches the data in the Company field in the other table (for example, when data in both tables is ABC Company).
4.
Click OK to save this relationship.
Prepare the Companies layout for the chart
1.
Choose Companies from the Layout pop-up menu in the layout bar.
Notice the Companies layout lists address information for XYZ Inc., which has members in The Corporate Travelers Club.
2.
3.
Click Edit Layout in the layout bar to switch to Layout mode.
You will place your chart below the fields already defined on this layout.
Create the bar chart to display member fees per company
1.
Click the Chart tool Chart tool in the status toolbar, then click in the body layout part underneath the fields and drag a large rectangle where you want the chart to appear.
2.
 
Click Specify button and choose Specify Calculation. In the Specify Calculation dialog box, type “Fee Paid by Members of & (including all characters shown). Next select the Members table from the list on the left, double-click ::Company in the list, and click OK.
Fee Paid by Members of & Members::Company
FileMaker Pro will use the text you typed as the beginning of the title and the data from the current record as the company name. Because the table associated with this layout is Companies, you must specify field names from the related Members table for the title to display correctly.
Click Specify button, choose Specify Field Name, choose the Members table, choose ::Last Name in the list, then click OK.
Data values from the Last Name field will appear as labels for the bars in your chart (X-series). This is the data you are comparing.
Click Specify button, choose Specify Field Name, choose the Members table, choose ::Fee Paid in the list, then click OK.
The bars in your chart will show the data values from the Fee Paid field (Y-series). This is the data you are measuring.
Choose Related Records.
Choose Members.
Change the color of the chart
1.
Click Format Chart.
2.
In the Format Chart dialog box, for Color Scheme, choose Rainbow.
The color of the chart updates in the preview pane on the right.
3.
In the list on the left, select Horizontal (X) Axis and for X-Axis Title, type Members.
Note  FileMaker Pro encloses your title text in quotation marks when you click outside the X-Axis Title field.
4.
For Label Angle, choose 45° to rotate the X-axis labels in your chart making them easier to read.
5.
In the list on the left, select Vertical (Y) Axis, and for Y-Axis Title, type Amount Paid.
This labels the data values you are measuring on the vertical axis of your chart.
6.
Select Set Y-Axis and for Max type 300.
This changes the scale of the Y-axis so the bars fill your chart.
7.
Click OK, then OK to close both dialog boxes.
You see placeholder data in the chart on your layout. You must switch to Browse mode to chart data from the sample database.
Verify the chart in Browse mode
1.
Click Save Layout, then Exit Layout in the layout bar.
You see the finished chart.
2.
The chart updates to show members of the company displayed from the current record.
Notes
 •
If your chart is hard to read or if the maximum value for the X-axis is higher than 300, return to layout mode, select the chart, and drag the handles to make the chart larger. Then return to Browse mode to verify the chart.
 •
Related topics 
About charts
Planning a chart
Creating and editing charts
Formatting charts
Example 2: Charting summary data
Example 3: Charting delimited data