GetCurve
Create a curve object based on two datasets
Create a curve object from a dataset. The X data comes from the worksheet default or row index
curvebase & GetCurve( int nColx, int nColy )
curvebase & GetCurve( int nColy )
A reference to the curvebase class object.
EX1
// Create a worksheet with sample data and an empty graph // Then plot the X vs. the Y void Worksheet_GetCurve_Ex1() { Worksheet wks; GraphPage gp; gp.Create("line.otp", CREATE_VISIBLE); wks.Create("origin.otw",CREATE_VISIBLE); // Newly created worksheet is active LT_execute("col(1)=data(1,30);col(2)=normal(30)*4+3;"); curvebase& crv = wks.GetCurve(1, 0); // Note how the designation is the reverse of the default XY designation GraphLayer gl; gl = gp.Layers(0); gl.AddPlot(crv); }
EX2
// Create a worksheet with sample data and an empty graph // Then plot the Y data in the graph void Worksheet_GetCurve_Ex2() { Worksheet wks; wks.Create("origin.otw",CREATE_VISIBLE); // Newly created worksheet is active LT_execute("col(1)=data(1,30);col(2)=normal(30)*4+3;"); curvebase& crv = wks.GetCurve(1); GraphPage gp; gp.Create("line.otp", CREATE_VISIBLE); GraphLayer gl = gp.Layers(0); gl.AddPlot(crv); }
origin.h