4D v13Building a graph |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D Chart v13
Building a graph
Building a graph
4D Chart allows you to create two-dimensional and three-dimensional graphs based on the data in fields in your database. You can graph the values in the fields themselves, or you can graph the values that result from formulas that use the fields. Whatever the case, when you create a graph, you select the data that you want to graph on each axis. For each axis, there are certain restrictions on the data types that can be graphed. If a data type cannot be graphed on a certain axis, fields of that type cannot be selected in the Chart Wizard. The following table provides information on the types of data that can be assigned to the Categories or Series axis and the Values axis.
(*) The Integer 64 bits and Float types are only used by the SQL engine of 4D. Before you begin the process of creating a graph, you must create a selection of records to graph. 4D Chart can operate in its own window or in 4D Chart areas on forms. 4D Chart graphs the records in the current selection. Before you create a graph in a plug-in window, select the records you want to graph. 4D Chart will not create a graph unless there is at least one record in the current selection of the table whose data you want to graph. A 4D Chart area in an input form can be used to graph data in other tables. The table whose records you want to graph must have at least one record in its current selection. If the table that contains the form is automatically related to the table you wish to graph, the current record in the input form determines the selection of records in the related table. Because you have a record loaded in an input form, you should avoid creating graphs from data in the current table. If you want to graph data from the same table as the input form, you must use PUSH RECORD and POP RECORD or create a new process with the New process function. For a two-dimensional graph, you specify a field for the horizontal axis (X-axis) and one or more fields or formulas for the vertical axis (referred to in 4D Chart as the Z-axis). For a three-dimensional graph, you will specify one field (or formula) each for the X-, Y-, and Z-axes. The following example graph shows how 4D Chart uses the information in the database to create a 2D graph. The graph plots the scores on two tests for each of 11 students. The X-axis field is Student ID, and the Z-axis fields are AOC Score and TUC Score. The following example graph shows how 4D Chart uses the information in the database to create a graph. The graph shows the average monthly stock value for two companies. The X-, Y-, and Z-axis fields are, respectively: Month, Company Name, and Average Price. To create a graph from data stored in the database: Note: Make sure that no graph is currently selected in the 4D Chart area. To deselect a selected graph, click anywhere in the 4D Chart area outside the graph.
You can graph data from any application if it is correctly formatted and then copied to the Clipboard. You can graph data that is formatted in the Tab-Tab-Return (TTR) format. If you copy cells from any spreadsheet application, they will be in TTR format. You can also use data from a word-processing application if it is formatted with tabs between the fields and carriage returns between the records. Following are examples of correctly formatted data:
The first row of data is used as the field names. Each column contains the data for one field. Note: If you want to use dates copied to the Clipboard, the dates must be in the same format as the System-level date format. When you have prepared the data in your application, select the desired rows and columns and copy them to the Clipboard. For a two-dimensional graph, you will specify a field for the X-axis and one or more fields or formulas for the Z-axis. The following illustration shows how 4D Chart interprets the information from the Clipboard.
For a three-dimensional graph, you specify one field each for the X-, Y-, and Z-axes. The following illustration shows the spreadsheet data used for the example graph. The information details the total sales by two different stores to three types of customers.
To create a graph from data stored on the Clipboard:
When you create a graph using the contents of the database, the data it contains are static. Even when the contents of the database change, the data of the graph can only be modified by an update. To update a 4D Chart graph, choose the Update command in the Chart menu of 4D Chart. You should update a graph in the following cases:
When you use the update, the graph remains the same with all the previously chosen options, but with a new selection of data. Note: The Update menu command is only enabled for graphs created using the contents of the database. Some categories or series may appear more than once in your data. For instance, suppose that you want to graph the total purchases made by each of your customers. Each customer may have made several purchases. When you create a two-dimensional graph, you can choose to sum the values for non-unique categories, so that each category appears only once on the graph. When you create a three-dimensional graph, you can choose to sum the values for non-unique categories, non-unique series, or both. To create the graph described in the example above, you might graph from the [Invoices] table, using [Invoices]Customer for the X-axis categories and [Invoices]SalesTotal for the Z-axis values. Because some customers may have more than one invoice, you would want 4D Chart to sum the values in the [Invoices]SalesTotal field so that there would be only one value (the total) for each customer. The illustrations below show the same basic graph with and without the Group option:
You can graph values that are not represented in your data but are obtained by performing calculations on the data or on other values in your database. For example, you can graph your profits by graphing the results of a formula that subtracts your unit cost from your retail price. You can refer to any function or valid 4D method “allowed” in the formula editor and graph the result on the Values axis. The method must return a value to 4D Chart. If the categories are grouped, 4D Chart sums the values returned. If there are fields or other formulas also being graphed on the Values axis, the data types of all the values must be compatible. For instance, if you are graphing a Date field and a formula on the Values axis, the formula must return a date. Note: Formulas are available only for two-dimensional graphs (see Types of 2D graphs). To use a formula to calculate values for a graph:
You can switch between chart types at any time. You can change from one two-dimensional graph type to another, or from one three-dimensional graph type to another. When creating a graph, feel free to experiment with chart types to find the best way to present your data. To change the chart type:
You can have 4D Chart display an alert dialog box when the user attempts to change the type of a graph. The user then has the option to cancel or continue with the change.
|
PROPERTIES
Product: 4D |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||