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
 Origin Forum
 bubble legend
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

maarnts

Netherlands
Posts

Posted - 05/01/2018 :  10:45:45 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver.2018 and Service Release 1 Operating System:W7

Is there a method to access the variables/options used in the bubble-legend via labtalk?

I'm able to add the legend via the command
run.section(Standard,Bubble);
to a graph, but I cannot change, for instance, the min and max values of the bubble chart via a labtalk command.

Shirley_GZ

China
Posts

Posted - 05/02/2018 :  05:45:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Maarnts,

Sorry, we don't have LabTalk commands to customize the bubble scale format. But you can use Origin C script instead, such as


bool test_buuble_format()
{
	GraphLayer layActive = Project.ActiveLayer();
	GraphObject go = layActive.GraphObjects("BUBBLELEGEND1");
	if(!go)
		return false;
		
	Tree trFmt;
	trFmt.Root.DimAxes.DimAxis2.Scale.From.dVal = 0;
	trFmt.Root.DimAxes.DimAxis2.Scale.To.dVal = 15;
	trFmt.Root.DimAxes.DimAxis2.Scale.IncrementBy.nVal = OAI_MAJORTICKCOUNT;//OAXISINCREMENT
	int nErr = go.UpdateThemeIDs(trFmt.Root);
	if(nErr == 0)
	{
		int nRet = go.ApplyFormat(trFmt, true, true);
	}
	return true;
}


This example can be used to change the From and To value at the Levels tab of Bubble Scale Control dialog,
https://www.originlab.com/doc/Origin-Help/BubbleScale#Levels

If you want to change other properties with Origin C treenode as above, please check the variable names in the Apply Format dialog as below:


The details of Apply Formats dialog can be found here,
https://www.originlab.com/doc/Origin-Help/CopyPaste-Format

Thanks,
Shirley

Originlab Technical Service Team
Go to Top of Page

maarnts

Netherlands
Posts

Posted - 05/06/2018 :  3:52:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Shirley
thanks for your answer.

With the script below I'm now able to control the bubble legend with labtalk.

However the lines
trFmt.Root.Page.AllLayers.AllBubbles.DimAxis2.AllNewAxis.Title.Show = true; //show title
trFmt.Root.Layout.Symbol.Style = 1; // no fill black line

give compile errors. (without them everything works fine)

I could not find any suggestions in the C help files how to deal with this. Can you please tell me what I am doing wrong?





bool bubble_legend_modification()
{
double bubble1;
double bubble2;
LT_get_var("bubble1" , &bubble1);
LT_get_var("bubble2" , &bubble2);

GraphLayer layActive = Project.ActiveLayer();
GraphObject go = layActive.GraphObjects("BUBBLELEGEND1");
if(!go)
return false;

Tree trFmt;
trFmt.Root.DimAxes.DimAxis2.Scale.From.dVal = bubble1;
trFmt.Root.DimAxes.DimAxis2.Scale.To.dVal = bubble2;
trFmt.IncrementBy.nVal = 4;//OAXISINCREMENT

trFmt.Root.Page.AllLayers.AllBubbles.DimAxis2.AllNewAxis.Title.Show = true; //show title
trFmt.Root.Layout.Symbol.Style = 1; // no fill black line

int nErr = go.UpdateThemeIDs(trFmt.Root);
if(nErr == 0)
{
int nRet = go.ApplyFormat(trFmt, true, true);
}
return true;
}


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