Author |
Topic  |
|
kanderlee
Taiwan
Posts |
Posted - 10/02/2007 : 03:53:15 AM
|
Origin Version : 7.5 sp4 Operating System: XP
I have a worksheet with "XYXY" columns, and I want to plot two independent curves in one graphpage using the template "Vertical 2 Pannel". (The function in Origin is Plot -> Panel -> Vertical 2 Pannel)
void Plot_2_Vert_Pannel() {
Worksheet wks = Project.ActiveLayer(); if( !wks ) { out_str("Active layer is not a worksheet!"); return; }
Dataset dsX(wks, 0); Dataset dsY(wks, 1); Dataset dsX2(wks, 2); Dataset dsY2(wks, 3);
GraphPage gpg; gpg.Create("PAN2VERT.OTP");
GraphLayer gly = gpg.Layers(0);
Curve crv(dsX, dsY); gly.AddPlot(crv, IDM_PLOT_LINE);
GraphLayer gly2 = gpg.Layers(1);
Curve crv2(dsX2, dsY2); gly2.AddPlot(crv2, IDM_PLOT_LINE); }
This program can show the template correctly, but there is no any curve on the graphpage! Could someone tell me what happened of my code? Thanks.
Edited by - kanderlee on 10/02/2007 04:17:25 AM |
|
Mike Buess
USA
3037 Posts |
Posted - 10/02/2007 : 09:48:44 AM
|
Your code works fine if you create the curves with crv(wks,0,1) or crv(dsX.GetName(),dsY.GetName()). Operations on a curve object created from two dataset objects, crv(dsX,dsY), do not affect those datasets which might have something to do with the fact that you can't plot your curves.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 10/02/2007 10:06:03 AM |
 |
|
kanderlee
Taiwan
Posts |
Posted - 10/02/2007 : 11:12:43 PM
|
Thank you, Mike.
As your suggestion, My code can work properly now! |
 |
|
|
Topic  |
|
|
|