2.2.4.17 GraphLayer


Name

GraphLayer

Remark

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.

Hierarchy

Examples

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
    }
}

Header to Include

origin.h

Reference

Members

Name Brief Example
AddErrBar Adds an error bar plot to an existing dataplot from Column object. Examples
AddLabelPlot Adds a label plot to an existing dataplot. Examples
AddPlot Add one data plot to layer Examples
AddPlots Add multiple dataplots onto graphlayer Examples
AddXErrBar Adds an X error bar plot to an existing dataplot. Examples
Attach Attached a layer in an Origin graph window to the object based on the graph name and the layer index. Examples
CanHaveEnhancedLegend Get Enhanced Legend propeties Examples
ClearMarkers Remove the markers in the current graphLayer. Examples
DataplotsGrouping Set/Get dataplots grouping status. Examples
ConvertByAxis It converts values back and forth between the real space and the "screen" space according to the axis scale of the graph layer. It really has effect only if the scale of the needed axis (the argument nAxis) is not linear. Examples
GetActualFontSizeText Get actual font size depends on the layet scale Examples
GetAllLinkedLayersFrame Get smallest frame that include all linked layers Examples
GetAxis Get Axis by dim index Examples
GetCoordinateType Gets the layer's coordinate system type. Examples
GetDataMarkers Get data marker. Examples
GetDateTimeHigherPrecisionDisplayFormat This function return a DateTime higher precision display format according to Axis specified Examples
GetEnhancedLegend Get(Construct) Enhanced Legend string Examples
GetFunctionPlots This function get all the function plots on this layer. Examples
GetGroupPlotsCount Get group plots count Examples
GetLayerContents get the contents of a graph layer into a tree Examples
GetScaleElements Get the scale elements related attributes of the layer Examples
GetSparkline
GraphLayer Construct and attach a GraphLayer object based on the name of the graph window and the layer index Examples
GroupPlots Groups dataplots in layer. Examples
Groups get a GroupPlot object from the graph layer Examples
ReorderPlot Reorder plot at specific index in the layer Examples
IsAxisZNeeded Is Z Axis needed in the layer Examples
MoveMarkerLine Move marker lines in layer. Examples
RemovePlot Removes one DataPlot from layer. The object is referred to by index. Examples
Rescale It rescales the graphic layer axes to show all dataplot points that may be outside the current axis ranges. Examples
SetDataMarkers Set data marker. Examples
SetMarkerLines Set marker lines in layer. Examples
SetScaleElements Set the scale elements related attributes of the layer Examples
SetShowMarkerLine Set show marker line Examples
UngroupPlots Ungroups dataplots. Examples

Property

Name Brief Example
DataPlots The Collection property of all DataPlots in the layer. Examples
StyleHolders The Collection property of all StyleHolders in the layer. Examples
X The "X" property - the Scale object representing the X-axis in the layer. Examples
XAxis The X axis object on the graphlayer Examples
Y The "Y" property - the Scale object representing the Y-axis in the layer. Examples
YAxis The Y axis object on the graphlayer Examples
ZAxis The Z axis object on the graphlayer Examples