3.3.2 Line Plot


Version Info

Minimum Origin Version Required: Origin80 SR0

Simple Line Plot

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();
}

Format Line Plot

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);
		}
    }
}