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
 Change Graph Style by Origin C code
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

a.abc.b35

175 Posts

Posted - 08/14/2013 :  01:40:55 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

greg

USA
1378 Posts

Posted - 08/22/2013 :  2:30:55 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.

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