Minimum Origin Version Required: Origin80 SR0
void simple_line_plot_ex() { Worksheet wks = Project.ActiveLayer(); if( !wks ) { out_str("Please activate one worksheet with data"); return; } GraphPage gp; gp.Create("Line"); GraphLayer gl = gp.Layers(0); Curve crv(wks, 0, 1); int nPlot = gl.AddPlot(crv, IDM_PLOT_LINE); // return plot index if( nPlot >= 0 ) gl.Rescale(); }
void format_line_plot() { GraphLayer gl = Project.ActiveLayer(); if( gl ) { Tree tr; tr.Root.Curves.Curve1.Line.Connect.nVal = 6; // step Horizontal, 0 offset tr.Root.Curves.Curve1.Line.Color.nVal = 1; // red tr.Root.Curves.Curve1.Line.Width.dVal = 1.5; if( 0 == gl.UpdateThemeIDs(tr.Root) ) // if no err { gl.ApplyFormat(tr, true, true); } } }