7.2 Adding Objects to Worksheet
Both worksheet header rows and data cells can contain embedded objects, linked objects as well as formatted text. In addition, floating graphs can be added to the worksheet like Excel.
Note: Beginning with Origin 2018, any inserted graph, whether it be a an editable graph, a graph inserted as a linked or static picture, an image inserted from file, or a sparkline, will generate a pop-up preview when you hover on the containing worksheet cell.
What you will learn
- How to insert various objects into a worksheet cell.
- How to add floating graph to worksheet.
Inserting Objects in Cells
- Start with a New Project by clicking on the New Project button .
- Click on the Import Wizard button . In the Import Wizard - Source page, browse to select S15-125-03.dat file in Origin's Sample\Import and Export folder. Click on the Finish button to complete the importing.
- Highlight columns A(X) and B(Y), choose Plot > 2D: Scatter: Scatter from the menu or click on the Scatter Plot button to create a graph.
- Return to the workbook and select the Column: Add New Columns... from the menu or click on the Add New Columns button to add 3 columns.
- Expand the workbook so you can see all 7 columns.
- In the row 1 of E(Y), type New Features and press Enter.
- Select cell E1， and then click the Bold button on the Format Toolbar.
- Click the Font Color button on the Format Toolbar and pick Yellow as the color.
- Click the Fill Color button on the Style Toolbar and pick Blue as the color.
- Select the range E1 to F1, click the Merge cells button .
- Right-click on cell G1 and choose Insert Arrow: Left from the context menu to insert a arrow to the cell.
- Select the range E2 to G12, click the Merge cells button .
- Right-click on the cell and choose Insert Graph.
- In the InsertGraph dialog, type Graph1 in the large Graphs box or click on the Browse button to select Graph1.
- Click OK to close this dialog.
- Right-click on E13 to choose Insert Images from Files from the context emnu.
- Click the Browse button and change the Files of Type to Bitmap (*.bmp).
- In the Origin User File Folder, select the Userdef.BMP, click Add File(s) button and then click OK button.
- Click OK button to close the InserImg dialog.
- Right-click on cell F13 to choose Insert Notes.
- Double-click on cell F13. Modify the text and then close the Notes window. A note wil be saved in the cell.
- Right-click in E14 and choose Insert Sparklines to open the InsertSparklines dialog.
- In the dialog, click the Data Columns fly-out button to choose C(Y). Uncheck Long Name in 1st Column check box.
- Click OK to close the dialog. A sparkline will appear in the cell.
- Click on cell E15 and type: http://www.originlab.com and press Enter.
- Click on the text in E15 which opens your web browser to the OriginLab web site.
- Click on cell E16 to choose Insert Variables from the context menu. The Insert Variable dialog opens.
- with the worksheet Book1 is selected in the right panel, go to the Info tab, expand the USER.VARIABLES branch, select SAMPLE and then click on the Insert button. A variable will be inserted to the cell.
- Double-click on the cell E16, the text will change to a variable string.
The Graph, Notes and Sparklines in the above lesson are all examples of embedded objects (the Insert Graph could be either Embedded or Linked.) Embedded objects present a visual of a hidden external object that can be opened by double-clicking. Changes to the object can be made and then the object window can be closed and the source worksheet cell is updated.
Adding floating Graph to worksheet
- Continue the above project. Highlight Col(D) in Book1 to plot a line graph.
- In Book1, right-click the empty area or title of the book to select Add Graph:Graph1 from the context menu. The graph is added to the sheet. Note: Origin pre-loads the last-created graph to the Add Graph shortcut command. If you only see the shortcut Add Graph (no named graph following the shortcut command), clicking Add Graph will open the Graph Browser. In the Graph Browser, select your graph and click OK to insert the graph and return to the worksheet.
- Left-click and hold down the mouse button on the graph and drag it to reposition it on the worksheet.