Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
Doltergost
Posted - 04/03/2024 : 09:27:16 AM Hi, with the following function i try to add another Plot to an existing Graphpage:
void addplot(string graphname, int plottyp, int MYFORM, int SYSCOLOR, Worksheet *ptrwks, int x1, int y1, string curvelabel) { PageBase pb = Project.Pages(graphname);
// Überürüfung ob ein solches Fenster existiert. if( !pb.IsValid() ) { printf("%s is not a valid window\n", graphname); return; }
GraphPage gp = pb; GraphLayer gl = gp.Layers(0);
// DataRange für plotten der Messdaten DataRange grafikdata1; grafikdata1.Add(*ptrwks,x1,"X"); grafikdata1.Add(*ptrwks,y1,"Y");
int iPlots = 0;
foreach(DataPlot dp in gl.DataPlots) { iPlots++; } //printf("%d\n",iPlots);
int nPlotIndex = gl.AddPlot(grafikdata1, plottyp); nPlotIndex = 1;
Tree tr0,tr1;
tr1.Root.Symbol.Size.nVal = 3; // Size of symbol tr1.Root.Symbol.Shape.nVal = MYFORM;
It does adding a Plot in the right color and edits the legend correctly, but the dp1.ApplyFromat doesnt work. It just changes the symbol to an right arrow.
2 L A T E S T R E P L I E S (Newest First)
Doltergost
Posted - 04/04/2024 : 02:59:14 AM Yeah, thank you.
YimingChen
Posted - 04/03/2024 : 10:19:45 AM Can you change the line
DataPlot dp1 = gl.DataPlots(iPlots);
to
DataPlot dp1 = gl.DataPlots(nPlotIndex);
I assume you want to change the format of the added plot.