2.1.14.1.9 graph_add_layer
Description
Add new layer in graph page.
Syntax
int graph_add_layer(GraphPage& gp, bool bBottom = true, bool bLeft = true, bool bTop = false, bool bRight = false, bool bAutoOffset = true, int nLinkTo = -1)
Parameters
- gp
- [input] graph page
- bBottom
- [input] if true contain bottom axis in new layer
- bLeft
- [input] if true contain left axis in new layer
- bTop
- [input] if true contain top axis in new layer
- bRight
- [input] if true contain right axis in new layer
- bAutoOffset
- [input] auto add offset if newly added layer overlap with previous layer
- nLinkTo
- [input] the index of the link to layer, -1 means not link to
Return
return the index of new layer, if fail, return -1.
Examples
EX1
void graph_add_layer_ex1()
{
GraphPage gp;
gp.Create("origin");
// add more layer with right Y axis
bool bBottom = 0, bLeft = 0, bTop = 0, bRight = 1; // add right-Y axis for new layer
bool bAutoOffset = true; // auto offset if newly added layer overlap with previous layer
int nLinkTo = 0; // link to the first layer
int index = graph_add_layer(gp, bBottom, bLeft, bTop, bRight, bAutoOffset, nLinkTo); // return the index of new layer
if( index >= 0 )
printf("Successfully add layer, index is %d\n", index);
}
Remark
See Also
Header to Include
origin.h
Reference
|