OriginPro Student 9.0.0, Win 7-64bit (running under WMware Fusion 5.0.2)
Using a "Script After Import" in an import filter, I'd like to create a graph and then add it to the worksheet containing the imported data (I'm using a workbook template). I have the graph creation code working (see below) but need help with the code to add the graph to the worksheet.
Use insertgraph to embed your graph into a cell in the worksheet. You may need to add a column first. Also, before creating the graph, I suggest saving the workbook and worksheet names because you may need them to address the cell.
For 9.0 users who want the new floating graph there is a new function:
string MyGraph; insert_graph_to_layer igname:=Graph2 ogname:=MyGraph; // NEW
The worksheet on which you want the floating graph should be active when the command executes.
You can use this code to (approximately!) position the graph to the right of the last column: %(MyGraph$).x=bmp.dx/2+wks.ncols; %(MyGraph$).y=-bmp.dy/2;