Insert: Table
Add a linked table to a graph or a layout
1. add_table_to_graph cols:=3 row:=3; 2. add_table_to_graph cols:=5 rows:=4 title:=mytable; 3. add_table_to_graph igl:=[graph1]layer1 cols:=5 rows:=4 title:=mytable col:=1;
Please refer to the page for additional option switches when accessing the x-function from script
Input
Layer
Specifies the graph layer to which the table should be added.
int
Specifies the number of columns in the table.
Specifies the number of rows in the table.
string
Specifies the title of the table.
Specifies whether to show the column label row.
Output
Specifies the string name used to store the name of the created table.
This function adds a linked table to a graph or a layout. This is usually for displaying additional information on the graph/layout.
The table is editable. To edit it, you can double-click on the table. Then it is opened and you can edit it as in the Origin Worksheet. When the editing is done, you can click the Update Table button to update the changes to the graph/layout.
In this example, we do simple statistics on sample data and then add the result to a table on graph.
//Create a new workbook newbook; //Import a file path$ = system.path.program$ + "Samples\Statistics\"; fname$ = path$ + "diameter.dat"; impasc; wks.col1.type=1; //Statisitcs and plot stats 1 mean:=mymean sd:=mysd n:=myn min:=mymin max:=mymax sum:=mysum; plotxy 1; add_table_to_graph cols:=2 rows:=5 tabname:=TableName$ title:="Basic Statistics"; //Fill table content range rr=[TableName$]1!col(1); rr[1]$=Mean; rr[2]$=SD; rr[3]$=N; rr[4]$=Min; rr[5]$=Max; range ss=[TableName$]1!col(2); ss = {mymean, mysd, myn, mymin, mymax}; doc -uw; //Refresh
add_graph_to_graph