2.2.3.17 insertGraph

Menu Information

Right-click context menu of worksheet cell: Insert Graph

Brief Information

Insert graph into a worksheet cell

Command Line Usage

1. insertGraph gname:=graph1;

2. insertGraph gname:=graph1 keepaspect:=0 resizecell:=0;

3. insertGraph gname:=graph3 embed:=1 keepaspect:=1 axes:=1 label:=1;

4. insertGraph gname:=graph1|graph2 embed:=0 keepAspect:=0;

X-Function Execution Options

Please refer to the page for additional option switches when accessing the x-function from script

Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Graphs gname

Input

string

<unassigned>
Specifies the graph(s) and Layout(s) to be embedded. Multiple windows are separated by '|' character.
Move Graph to cell (Embedding) embed

Input

int

1
Specifies whether or not to embed the graph into the worksheet cell. If this checkbox is cleared, the graph will be linked to the graph. Otherwise, the graph will be embedded into the cell.
Display Caching display

Input

int

0
Specify the method of display caching.

Option list:

  • emf:Enhanced Metafile
    Display the inserted graph in EMF format.
  • bmp:Bitmap
    Display the inserted graph in BMP format.
Resize Cell resizecell

Input

int

0
Specifies whether or not to resize the worksheet cell to fit the embedded or linked graph.
Keep Aspect Ratio keepAspect

Input

int

1
Specifies whether or not to keep the aspect ratio of the graph.
Hide Axes and Legend axes

Input

int

0
Specifies whether or not to hide the axes of the graph when it is displayed in the worksheet cell.
Hide Text Labels label

Input

int

0
Specifies whether or not to hide the text labels on the graph when it is displayed in the worksheet cell.
Top Left Cell cell

Output

Range

<active>
Specifies the top left cell where the first graph will be inserted. Other graphs, if any, will be inserted in cells to the right then below.

Description

This X-Function inserts the chosen graph(s) and Layout(s) into specified cell in a worksheet.

Inserted graphs/layouts can be either embedded or linked.

  • When a graph/layout is embedded, it is moved into the worksheet cell. You can open the graph again by double-clicking on the cell. When open, embedded graph is closed, there is no prompt to Hide or Delete since the graph still exists as an embedded graph.
  • When a graph is linked, it will not be moved into the cell. However, you can double-click the image of the graph in the cell, and the source graph window and the folder in which it resides will become active.

Related X-Functions

insertImg, insertNotes, insertSparklines, insertArrow, insertVar