Worksheet::EmbedGraph
EmbedGraph
Description
Attaches a graph to Worksheet cell
Syntax
BOOL EmbedGraph( int nRow, int nCol, GraphPage & gp, DWORD dwEmbedInfo = 0 )
Parameters
- nRow
- [input] row index of the cell where the graph needs to be attached
- nCol
- [input] column index of the cell where the graph needs to be attached
- gp
- [input] GraphPage object that will be attached to the cell.
- dwEmbedInfo
- [input]can be one or more of the following:
- EMBEDGRAPH_KEEP_ASPECT_RATIO = 0x00000010, // Keep Aspect Ratio
- EMBEDGRAPH_DO_UNDO = 0x00000040, /// Allows undo of the attachment
- EMBEDGRAPH_IN_LABELS = 0x00000020, // Embeds the graph in Label
- EMBEDGRAPH_HIDE_AXES = 0x00000100, // hides Axes
- EMBEDGRAPH_HIDE_LEGENDS = 0x00000200, // hides legends
- EMBEDGRAPH_HIDE_SPECTRUMS = 0x00000400, // hides spectrums
- EMBEDGRAPH_HIDE_TEXT_OBJS = 0x00000800, // hides texts
- EMBEDGRAPH_SPARKLINE_LARGE = 0x00004000, // the copy in clipboard is larger than default
- EMBEDGRAPH_SPARKLINE_CLIPBOARD = 0x00008000, // put a copy onto clipboard
- EMBEDGRAPH_CACHE_IN_PAGE = 0x00100000, // cache image in page
Return
returns TRUE if successful
Examples
EX1
//Attach Graph1 to worksheet cell.
void Worksheet_EmbedGraph_Ex1()
{
Worksheet wks = Project.ActiveLayer();
if(!wks)
return;
GraphPage gp("Graph1");
if(!gp)
return;
wks.EmbedGraph(0, 0, gp);
}
EX2
//Add Graph1 as a new sheet of Book1.
void Worksheet_EmbedGraph_Ex2()
{
WorksheetPage wp("Book1");
if(!wp)
return;
int index = wp.AddLayer();
Worksheet wks = wp.Layers(index);
if(!wks)
return;
GraphPage gp("Graph1");
if(!gp)
return;
wks.SetAsHolderSheet();
wks.EmbedGraph(0, 0, gp, EMBEDGRAPH_KEEP_ASPECT_RATIO);
}
Remark
See Also
Worksheet::EmbeddedPages, Worksheet::EmbedMatrix, Worksheet::EmbedNote
Worksheet::SetAsHolderSheet
header to Include
origin.h