The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Create graph from origin C
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

naeem498

17 Posts

Posted - 10/24/2011 :  06:31:13 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

Can I make a graph using origin c coding. Actually, I have 44 workbooks and I want to make 44 graphs taking specific data set in each workbook. I want to use my own 'plot tempelate'.

I used the code given in the origin_c_programming book, but it does not work.

Thanks

Penn

China
644 Posts

Posted - 10/24/2011 :  9:47:49 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

About how to plot, please refer to Plotting. You can use your own template when creating a graph, and then add plot to this graph. For example, suppose the template is named "Line00":

void simple_line_plot_ex()
{    
	Worksheet wks = Project.ActiveLayer();  // get the active worksheet
	if( !wks )
	{	
		out_str("Please activate one worksheet with data");
		return;
	}	 
	GraphPage gp;
	gp.Create("Line00");  // create a graph with Line00 template
	GraphLayer gl = gp.Layers(0);  // layer 1 of the graph
	Curve crv(wks, 0, 1);
	int nPlot = gl.AddPlot(crv, IDM_PLOT_LINE); // add a line plot to the graph, return plot index
	if( nPlot >= 0 )
		gl.Rescale();  // rescale the graph
}


Penn

Edited by - Penn on 10/24/2011 9:48:33 PM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000