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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Change Graph Style by Origin C code

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
a.abc.b35 Posted - 08/14/2013 : 01:40:55 AM
I have a graph with multiple plots in stacks. In each stack window, I have a a few points plotted with error bars and a line fitted through them. For all the stacks, I want to achieve the following by a single code in Origin C (and also have the code flexible for future use):
1. Change the size of the points to value v1.
2. Change the line width and cap width of the error bar to some values v2 and v3.
3. Change the line width of the fitted line to v4.
4. Change the size of tick label points to v5.
5. Change the size of labels to v6.
6. Change the thickness and major tick length to v7 and v8.
.......................
Is there a way someone can help me with a origin C code to accomplice all these. Using theme etc. is not helping much.

AB
1   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 08/22/2013 : 2:30:55 PM
What you are trying to do does not make a lot of sense. For example, items 1, 2 and 3 are actually three different dataplots so you would need three more variables to tell the function which dataplot is which.
The properties in an Error Bar dataplot are not the same as the properties in a symbol plot for example and maybe you really should create several simpler functions which you can then wrap into your super function.

e.g.
For the symbol size...
Once you have the Scatter DataPlot object you can get its format tree, change the symbol size and update:
Tree tr;
tr = dp1.GetFormat(FPB_ALL, FOB_ALL, true, true);
tr.Root.Symbol.Size.nVal = 18; // or one of your v
if(0 == dpl.UpdateThemeIDs(tr.Root) )
dpl.ApplyFormat(tr, true, true);
else
printf("Problem updating theme ids\n");

For the Error Bar...
Tree tr;
tr = dp2.GetFormat(FPB_ALL, FOB_ALL, true, true);
tr.Root.ErrorBar2D.CapWidth.nVal = 10; // or one of your v
tr.Root.Line.Width.nVal = 1; // or one of your v
if(0 == dp2.UpdateThemeIDs(tr.Root) )
dp2.ApplyFormat(tr, true, true);
else
printf("Problem updating theme ids\n");

and for the fit line...
Tree tr;
tr = dp3.GetFormat(FPB_ALL, FOB_ALL, true, true);
tr.Root.Line.Width.nVal = 2; // or one of your v
if(0 == dp3.UpdateThemeIDs(tr.Root) )
dp3.ApplyFormat(tr, true, true);
else
printf("Problem updating theme ids\n");

You can get the X Axis property tree with:
Tree tr;
tr = GraphLayerObject.GetFormat(FPB_ALL, FOB_AXIS_LABELS, TRUE, TRUE);
tr.Root.Axes.X.Labels.BottomLabels.Font.Size.nVal = 12;
if(0 == GraphLayerObject.UpdateThemeIDs(tr.Root) )
GraphLayerObject.ApplyFormat(tr, true, true);
else
printf("Problem updating theme ids\n");

You can run in debug and inspect all the tree properties for each type of tree.


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000