4D v13.4GRAPH |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v13.4
GRAPH
GRAPH
Compatibility note: Beginning with 4D v13, the 4D Chart plug-in is no longer integrated in 4D and must be installed specifically if you want to use it. For compatibility, the GRAPH command can still generate graphs using this plug-in when it is present, but we strongly recommend using the integrated SVG rendering engine instead. GRAPH draws a graph for a picture variable located in a form on the basis of values coming from arrays. The GRAPH command must be placed in the form method or in an object method belonging to the form, or yet again in a project method called by one of these two methods. The graphs generated by this command are drawn using the integrated SVG rendering engine. They have interface functions associated with picture variables: a context menu in Application mode (to let you choose, more particularly, the display format), scrollbars, and so on. Specific IDs are assigned automatically to elements present in the graph generated, that you can use to handle them individually (see the following paragraph). Note: SVG (Scalable Vector Graphics) is a graphics file format (.svg extension). Based on XML, this format is widespread and can be displayed more particularly in Web browsers. For more information, please refer to the following address: http://www.w3.org.Graphics/SVG/. The SVG EXPORT TO PICTURE command can also be used to take advantage of the integrated SVG engine. In the graphArea parameter, pass the name of the picture variable that displays the graph in the form. Note: For compatibility, the command also accepts a graph area or a 4D Chart area reference in the graphArea parameter, but we no longer recommend using this syntax. The graphNum parameter defines the type of graph that will be drawn. It must be a number from 1 to 8. The graph types are described in Example 1. After a graph has been drawn, you can change the type by changing graphNum and executing the GRAPH command again. The xLabels parameter defines the labels that will be used to label the x-axis (the bottom of the graph). This data can be of string, date, time, or numeric type. There should be the same number of array elements in xLabels as there are subrecords or array elements in each of the yElements. The data specified by yElements is the data to graph. The data must be numeric. Up to eight data sets can be graphed. Pie charts graph only the first yElements. Specific IDs are now assigned automatically to elements found in the SVG graph:
The following example shows the different types of graphs that you can obtain. The code would be inserted in a form method or object method. It is not intended to be realistic, since the data is constant: C_PICTURE(vGraph) //Variable of graph The following figures show the resulting graph.
|
PROPERTIES
Product: 4D
INDEX HISTORY
SEE ALSO
GRAPH SETTINGS |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||