Hi Dirk,
Please try the following function. I tried to add right axes title by format tree, but failed. Seems this property cannot be created by this way. In Origin8.0, there is not OC function to do this, so I used LT command in below function. But in Origin8.1, add AxisObject::GetTitleObject to AxisObject class to get title object, if not existed, will add firstly.
void testFormatTree()
{
GraphPage gp;
gp.Create("Origin");
GraphLayer gl = gp.Layers(0);
Tree MyTree;
MyTree.Root.Axes.Y.Ticks.RightTicks.AddNode("Show").nVal = 1;
MyTree.Root.Axes.Y.Labels.RightLabels.AddNode("Show").nVal = 1;
int nn = gl.UpdateThemeIDs(MyTree.Root);
if( 0 == nn )
{
if( gl.ApplyFormat(MyTree, true, true, true) )
out_str("Set format done!!");
}
// In Origin8.1 you can use:
/*
AxisObject aoYR = gl.YAxis.AxisObjects(AXISOBJPOS_AXIS_SECOND);
if( aoYR )
{
GraphObject goTitle = aoYR.GetTitleObject("TextRight");
}
*/
// In Origin8.0, you can use LT to add right axes title.
gl.LT_execute("lab -yr TextRight");
// set right axes title Angle to 90 and set link it to variables.
Tree trCheck;
trCheck = gl.GetFormat(FPB_ALL, FOB_ALL, true, true);
trCheck.Root.Axes.Y.Titles.RightTitle.Angle.nVal = 90;
trCheck.Root.Axes.Y.Titles.RightTitle.LinkToVars.nVal = 1;
nn = gl.UpdateThemeIDs(trCheck.Root);
if( 0 == nn )
{
if( gl.ApplyFormat(trCheck, true, true, true) )
out_str("Set format done!!");
}
}
Iris