Did you mean adding a inset to a graph. If it is, here just give a brief example:
void Add_Inset_Graph()
{
//Graph1 is the source graph
//maybe there are more than one layer in the graph.
//if it is, you need a loop to get all the layers
GraphLayer glSource("Graph1", 0);
//Graph2 is the destination graph
GraphPage gpDest("Graph2");
//add a new layer to hold the source graph
gpDest.AppendLayers("origin");
GraphLayer glDestNew = gpDest.Layers(gpDest.Layers.Count()-1);
//get the data plots from the source graph,
for(int nPlot=0; nPlot<glSource.DataPlots.Count(); nPlot++)
{
DataPlot dpSource = glSource.DataPlots(nPlot);
//In ver7.5, GraphLayer::AddPlot() only supports Curve as parameter, so need get the Curve from DataPlot
Curve crv(dpSource);
int nRes = glDestNew.AddPlot(crv);
}
//Using LabTalk script to control the positon of the layer
LT_execute("layer 20 20 40 5;");
}
Zachary
OriginLab Technical Services.
Edited by - zachary_origin on 10/10/2006 12:26:58 AM