GraphLayer
The GraphLayer class provides methods and properties common to all Origin graph layers.
Internal Origin graph pages contain one or more graph layers thus the Origin C GraphPage class contains a collection of one or more GraphLayer objects. Origin graph layers may contain Origin data plots thus the Origin C GraphLayer class contains a collection of DataPlot objects.
An Origin C GraphLayer object is a wrapper object that is a reference to an internal Origin graph layer object. Origin C wrapper objects do not actually exist in Origin and merely refer to the internal Origin object. Consequently, multiple Origin C wrapper objects can refer to the same internal Origin object.
The GraphLayer class is derived from the Layer and OriginObject classes from which it inherits methods and properties.
EX1
//Draw a dataplot and change the color to green. void GraphLayer_ex1() { Worksheet wks; wks.Create("origin"); Dataset ds1(wks,0); Dataset ds2(wks,1); ds1.Data(1,20,1); ds2.Normal(20); GraphPage gp; gp.Create("origin"); GraphLayer gl(gp.GetName(), 0); gl.AddPlot(wks); if(gl) { DataPlot dp = gl.DataPlots(0); // Get first data plot in graph layer dp.SetColor(2); // Change color to green } }
origin.h