2.2.4.17 GraphLayer


Contents

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
Adds an error bar plot to an existing dataplot from Column object.
Adds a label plot to an existing dataplot.
Add one data plot to layer
Add multiple dataplots onto graphlayer
Adds an X error bar plot to an existing dataplot.
Attached a layer in an Origin graph window to the object based on the graph name and the layer index.
Get Enhanced Legend propeties
Remove the markers in the current graphLayer.
Set/Get dataplots grouping status.
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.
Get actual font size depends on the layet scale
Get smallest frame that include all linked layers
Get Axis by dim index
Gets the layer's coordinate system type.
Get data marker.
This function return a DateTime higher precision display format according to Axis specified
Get(Construct) Enhanced Legend string
This function get all the function plots on this layer.
Get group plots count
get the contents of a graph layer into a tree
Get the scale elements related attributes of the layer
Get the sparkline into the PictureHolder
Construct and attach a GraphLayer object based on the name of the graph window and the layer index
Groups dataplots in layer.
get a GroupPlot object from the graph layer
Check the specified DataRange if has been plotted in GraphLayer
Is Z Axis needed in the layer
Move marker lines in layer.
Removes one DataPlot from layer. The object is referred to by index.
Removes all dataplots from layer.
Reorder plot at specific index in the layer
It rescales the graphic layer axes to show all dataplot points that may be outside the current axis ranges.
Set data marker.
Set marker lines in layer.
Set the scale elements related attributes of the layer
Set show marker line
Ungroups dataplots.

Property

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