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
 Curve was missing
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

xhzeng

Germany
2 Posts

Posted - 02/11/2003 :  04:33:17 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi all,

I tried to make some functions to import a file into a worksheet, the worksheet object is related to a Graph object, i.e. it provides data to the Graph. The data file is created by other MathCad. I hope the curve in the Graph will change corresponding to the change of data in the worksheet.

the following is my main idea:
1. Open data file(e.g data.txt);
2. declare a worksheet and attach a exsiting worksheet object to it;
3. insert those data from data.txt into the worksheet;
Up to now, it works pretty well, it really imported the data to the worksheet. The problem is, after the data was imported into the worksheet, the curve in the Graph was missing.

Is there anything else I should do to take care of the Graph object?

Thanks a lot.

Richard

easwar

USA
1965 Posts

Posted - 02/11/2003 :  09:46:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Richard,

Was your graph already set up? Was there a data plot assignment in the graph layer from your worksheet? If that is the case, you may just need to add a rescale command. If that is not the case, you may have to add code to add a data plot to the layer etc. You should look at the GraphLayer class for more documentation on this. You could also post your code here and have someone suggest what more to add to it.

Easwar
OriginLab.

Go to Top of Page

xhzeng

Germany
2 Posts

Posted - 02/11/2003 :  11:27:52 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Easwar,

Thank you very much!

I have resolved that problem. The reason is I didnt convert the data from string to numeric.
e.g.
string price = "123.50";
wk.SetCell(0, 0, price); (Wrong!)
we.SetCell(0, 0, atof(price)); (Correct!)

Richard
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