Subscribe Bookmark RSS Feed

GetGraphicItemByName Requires the name, where are the names listed please?

mattpace0

Occasional Contributor

Joined:

Aug 23, 2016

I see to operate on a chart axis for example I need to get a handle to it.  I assume GetGraphicItemByName is the way this is done.  But, where do the correct names come from please?

6 REPLIES
txnelson

Super User

Joined:

Jun 22, 2012

When you have an output from JMP, you can take a look at the report output objects and their names by right clicking on the gray triangle next to the outline box for the object you are interested in and selecting to Show the Tree Structure

12961_pastedImage_0.png

Here is the displayed tree structure

12965_pastedImage_1.png

If the Y axis is the axis you want, you would refer to it by the name, Axis Box(1).

Using

     Help==>Scripting Index

and looking up Axis Box, you will see the way to make changes to the AxisBox, and all of the different items you can change, along with an actual code example

12966_pastedImage_2.png

Jim
mattpace0

Occasional Contributor

Joined:

Aug 23, 2016

Hi Jim,

I appreciate your response.

I must work in VBA.   it is a distribution.  If I am understanding the horizontal axis is axis box(4).

I have tried several permutations of this, caps, no caps, space no space.

Each time JMP crashes.

Any help is greatly appreciated

Dim Hist As JMP.Distribution
Set Hist = DOCjmp.CreateDistribution

Hist.LaunchAddColumn "tr_REG_30B2_READ"

   

Box = Hist.GetGraphicItemByName("axis box(4)")

   

Hist.AxisBoxScale Box, axisScaleLog
Hist.Launch
briancorcoran

Joined:

Jun 23, 2011

Hi Matt,

You want to use GetGraphicItemByType .  You can specify the index for the item that you want there.  The Analysis.NET example that ships in the VB examples can show you.  Look under the Display Tree Operations button.  A snippet from there:

h2 = Distrib.GetGraphicItemByType("Outline Box", 1)

Distrib.OutlineBoxSetTitle(h2, "MyTitle")

GetGraphicItemByName can be used to get things like Outline nodes that have distinctive names in them, like "More Moments" or "Summary Statistics".  If there are more than one display object with that name, you will likely get the first.

The operations that can be performed once you have the handle to your graphic item are dictated by the item type.  The methods that you can call are often prefixed by that type, like OutlineBoxSetTitle can be used on Outline Boxes or in your case AxisBoxScale.  Please note that in your case, you cannot do anything to the Axis until after the Launch operation is performed.  There are no display boxes until you actually do that launch, so there is no box that can be returned by GetGraphicItemByType until after Launch is called.

I hope that helps.

Brian

mattpace0

Occasional Contributor

Joined:

Aug 23, 2016

Thank you very much.

mattpace0

Occasional Contributor

Joined:

Aug 23, 2016

Hey There,

Are you able to show me how to manually scale the axis in a distribution please.  I do not see any option to set the scale other than log / lin

briancorcoran

Joined:

Jun 23, 2011

I don’t have an example to show you. I believe you use AxisBoxNumericOption to set the Minimum and Maximum values. You can also set the number of ticks and minor ticks, but that is the extent of the axis support.

Brian