Hi,
The example below only for 1), but existed bug, we tracker in #12575.
void testOK1()
{
GraphLayer gl = Project.ActiveLayer();
if(!gl)
return;
Tree tr;
tr.Root.Page.Layers.All.Axes.X.Scale.MinorTicksCount.nVal = 3; // auto add nodes and assign 3 to MinorTicksCount
if(0 == gl.UpdateThemeIDs(tr))//0 for no error. ==> Failed here now
{
bool bRet = gl.ApplyFormat(tr.Root);
if(!bRet)
out_str("Fail to apply");
}
}
This example for 2) and 3):
//Include grobj_utils.h in order to do 2), this header only support from Origin80.
#include "grobj_utils.h"
//Note!! before compiling please add grobj_utils.c from OriginC\Originlab directory to workspace
void testOK2()
{
GraphLayer gl = Project.ActiveLayer();
if(!gl)
return;
// for 2) Create a Title
GraphObject goNew;
double x = 35, y = 50;
string strText = "This is my new title";
add_text(gl, goNew, x, y, strText);
// for 3) do you really want change name? The following codes show how to change label text of Axis
GraphObject goXL = gl.GraphObjects("XB"); // XB is the label name of X axis, YL is the label name of Y axis
if(goXL)
{
string str = goXL.Text;
out_str("Old Label: " + str);
goXL.Text = "New Label";
}
gl.GetPage().Refresh(); // to refresh page on changes
}
And could you give more detail about 4)?
Iris