Thank you greatly.
Now i found a Treenode:
Root.Groups.Group1.Nester
when i make a LINESYMB Plot and give the color -9, then all the curves get colored correctly in different colors. When i make a SCATTER Plot, all outher parameters are kept, all curves are black. The treenode above is the one thats different in both graphics. In the LINESYMB Plot the value of it is 1:{4} or 1:{0}. I tried to set it like
trFormat.Root.Groups.Group1.Nester.dVal = 4
trFormat.Root.Groups.Group1.Nester.dVal = 0
trFormat.Root.Groups.Group1.Nester.nVal = 0
but i always the errormassage that the treenode doesnt exist or that i dont have access to it.
Is there a way to assign the automated coloring for the scatterplot like for the linesymbplot?
My plotting code below:
void addplot(string graphname, int plottyp, int form, int color, Worksheet *ptrwks, int x1, int y1, string curvelabel, int keep = 1, int symbolsize = 3, int xscale = 1, string directory = "none", int layernumber = 0, int xscaletype = 0, string xlabel = "%(?X)", string ylabel = "%(?Y)")
{
PageBase pb = Project.Pages(graphname);
GraphPage gp;
int newgp = 0;
// Überürüfung ob ein solches Fenster existiert.
if( pb.IsValid() )
{
if(keep >= 1)
{
gp = pb;
}
if(keep == 0)
{
pb.Destroy();
}
}
if( !pb.IsValid() )
{
gp.Create("Origin");
gp.SetName(graphname);
newgp = 1;
}
GraphLayer gl = gp.Layers(layernumber);
if(newgp != 0)
{
GraphObject grXL = gl.GraphObjects("XB"); // Get X axis label
GraphObject grYL = gl.GraphObjects("YL"); // Get Y axis label
grXL.Text = xlabel;
grYL.Text = ylabel;
}
// 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++;
}
int nPlotIndex = gl.AddPlot(grafikdata1, plottyp);
Tree tr0,tr1;
tr0.Root.Axes.X.Labels.BottomLabels.DivideByFactor.dVal = xscale;
tr0.Root.Axes.X.Scale.Type.nVal = xscaletype;
if(xscale == 60)
{
tr0.Root.Axes.X.Scale.IncrementBy.nVal = 0;
tr0.Root.Axes.X.Scale.Value.dVal = 600;
}
else if(xscale == 3600)
{
tr0.Root.Axes.X.Scale.IncrementBy.nVal = 0;
tr0.Root.Axes.X.Scale.Value.dVal = 3600;
}
tr1.Root.Symbol.Size.nVal = symbolsize; // Size of symbol
tr1.Root.Symbol.Shape.nVal = form;
GraphObject go;
go = gl.GraphObjects("Legend");
string temp;
temp = go.Text;
if(iPlots == 0)
{
go.Text = "\l(" + (nPlotIndex+1) + ")\c"+ (color+1) + "(" + curvelabel + ")";
}
else
{
go.Text = go.Text + "\n\l(" + (nPlotIndex+1) + ")\c"+ (color+1) + "(" + curvelabel + ")";
}
if(layernumber == 1)
{
go = gp.Layers(0).GraphObjects("Legend");
go.Show = 0;
go = gl.GraphObjects("XB"); // Get X axis label
go.Show = 0;
}
DataPlot dp1 = gl.DataPlots(nPlotIndex);
dp1.SetColor(color,TRUE);
bool bRet;
if(color == -9)
{
gp.Layers(layernumber).GroupPlots(0);
}
if( 0 == dp1.UpdateThemeIDs(tr1.Root))
{
bRet = dp1.ApplyFormat(tr1, true, true);
}
if(gp.Layers(layernumber).UpdateThemeIDs(tr0.Root) == 0)
{
gp.Layers(layernumber).ApplyFormat(tr0, true, true);
}
if(nPlotIndex >= 0)
{
gl.Rescale();
}
PageBase pb2 = Project.Pages(graphname);
if( directory != "none")
{
Folder fldroot = Project.RootFolder;
Folder fldpb = pb2.GetFolder();
BOOL nRet = fldpb.Move(graphname,fldroot.GetPath() + directory);
}
}
Thanks in advance