Hi,
The page is aligned with the top left corner of the page being at the top left corner of the graph window. The layers inside the page have control as to how much gap there should be at the left, top etc within the page, in addition to the layer height and width...is this what you wanted?
The code segment below shows how to resize a layer inside a page. It also shows how to get to the axis scale properties as well. Note that here I am not using a tree. It is helpful to copy the properties to a tree to debug/print tree etc to see what is available, but if one knows the properties, one can instead directly get and set them as well.
Please post again if this did not answer your question.
Easwar
OriginLab
void test()
{
// Create a new page
GraphPage gp;
gp.Create();
if( !gp.IsValid() )
{
printf( "Cannot create new GraphPage\r\n" );
return;
}
// Set the page size to be 5 in x 5 in
gp.Dimension.Height.dVal = 5;
gp.Dimension.Width.dVal = 5;
// Set the size of layer 1 to be 3 inx 3 in with a 1 in border
GraphLayer gly = gp.Layers(0);
int iLyUnits = gly.Dimension.Units.nVal;
// If units is not in inches, change to inches temporarily
bool bChangedUnits;
if( iLyUnits != 1 )
{
gly.Dimension.Units.nVal = 1;
bChangedUnits = true;
}
// Set dimensions of the layer
gly.Dimension.Height.dVal = 3;
gly.Dimension.Width.dVal = 3;
gly.Dimension.Left.dVal = 1;
gly.Dimension.Top.dVal = 1;
// If units were switched, then switch back
if( bChangedUnits) gly.Dimension.Units.nVal = iLyUnits;
// Set x axis scale from 0 to 100
Axis axX = gly.XAxis;
axX.Scale.From.dVal = 0;
axX.Scale.To.dVal = 100;
}