Example 3: Charting related recordsThis example is based on the database of a fictitious business named Favorite Bakery. Use the FileMaker Pro tutorial sample file, Sample.fmp12, to create this chart. The sample file is located in:FileMaker Pro 12/English Extras/TutorialFileMaker Pro 12 Advanced/English Extras/TutorialIn this example, you create a bar chart that displays discount program fees paid by corporate customers of Favorite Bakery. 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 data for each company as you browse through the three company records.
1.
1.
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 Customers 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.
1. Notice the Companies layout lists address information for XYZ Inc., a corporate customer of Favorite Bakery.
2. Click to browse through the three records and see information for the other two companies, then display record for the ABC Company.
3.
1. Click the Chart tool in the status toolbar, then click in the body layout part and drag a large rectangle where you want the chart to appear.
2. In the Chart inspector, click Data Source, then enter the following settings:
Choose Related Records. Choose Customers.
3. Click Chart and enter the following settings:
Use a calculation to enter the chart title so it updates automatically when users browse through records in the database:Click and choose Specify Calculation. In the Specify Calculation dialog box, type the following, then click OK: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 Customers table for the title to display correctly. Choose Bar. For Data, click , choose Specify Field Name, choose the Customers 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 (x-series). This is the data you are measuring. For Data, click , choose Specify Field Name, choose the Customers 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. This is the data you are comparing. Select Show data points on chart.Tip You can click or drag the angle control to reposition data labels.
4. Click Done to close the Chart Setup dialog box.
5. The chart updates to show customers of the company displayed in the current record. You might need to return to layout mode and resize the chart for data to display correctly.