<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic JSL - get open graphs X and Y values in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-get-open-graphs-X-and-Y-values/m-p/371280#M62118</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I have a script that lets me pick in a combo box any data table that is open&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="itzikd_0-1616665900211.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/31532i4C24ADA37B8D735B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="itzikd_0-1616665900211.png" alt="itzikd_0-1616665900211.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I have a data table that has graphs under it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can I select this graphs?&lt;/P&gt;&lt;P&gt;the reason is that I want to get their X and Y columns names&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example in the first graph that is marked in the picture above I want to get test and test2&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="itzikd_2-1616666198379.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/31534i0A5095BE8D8028EB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="itzikd_2-1616666198379.png" alt="itzikd_2-1616666198379.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this graphs are already open in JMP and I don't have control over them (in terms of editing the script that creates them)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 22:09:34 GMT</pubDate>
    <dc:creator>itzikd</dc:creator>
    <dc:date>2023-06-09T22:09:34Z</dc:date>
    <item>
      <title>JSL - get open graphs X and Y values</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-get-open-graphs-X-and-Y-values/m-p/371280#M62118</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I have a script that lets me pick in a combo box any data table that is open&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="itzikd_0-1616665900211.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/31532i4C24ADA37B8D735B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="itzikd_0-1616665900211.png" alt="itzikd_0-1616665900211.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I have a data table that has graphs under it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can I select this graphs?&lt;/P&gt;&lt;P&gt;the reason is that I want to get their X and Y columns names&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example in the first graph that is marked in the picture above I want to get test and test2&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="itzikd_2-1616666198379.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/31534i0A5095BE8D8028EB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="itzikd_2-1616666198379.png" alt="itzikd_2-1616666198379.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this graphs are already open in JMP and I don't have control over them (in terms of editing the script that creates them)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 22:09:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-get-open-graphs-X-and-Y-values/m-p/371280#M62118</guid>
      <dc:creator>itzikd</dc:creator>
      <dc:date>2023-06-09T22:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: JSL - get open graphs X and Y values</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-get-open-graphs-X-and-Y-values/m-p/371309#M62121</link>
      <description>&lt;P&gt;Given that you didn't have control of the JMP session before you run the code that you want to write, you could try this kind of approach:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

tableOfInterest = "Big Class";

allWindows = GetWindowList();
tableWindows = {};
for (w = 1, w &amp;lt;= NItems(allWindows), w++,
	winTitle = allWindows[w] &amp;lt;&amp;lt; GetWindowTitle;
	if (StartsWith(winTitle,tableOfInterest) &amp;amp; (allWindows[w] &amp;lt;&amp;lt; WindowClassName) == "Report", InsertInto(tableWindows, allWindows[w]));
);

for (w = 1, w &amp;lt;= NItems(tableWindows), w++,
	Print(tableWindows[w] &amp;lt;&amp;lt; GetWindowTitle);
	);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Use 'Help &amp;gt; Scripting Index' to see how the various commands work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have the list of child reports, you can inspect each to pull out whatever you want. But bear in mind that the report trees can be complex, so this might take some work to make it sufficiently robust.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 11:03:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-get-open-graphs-X-and-Y-values/m-p/371309#M62121</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2021-03-25T11:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: JSL - get open graphs X and Y values</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-get-open-graphs-X-and-Y-values/m-p/371362#M62125</link>
      <description>&lt;P&gt;Thanks for the help&lt;/P&gt;&lt;P&gt;I now want to get the X Y values (what's marked in red) but I'm not sure how to access that value&lt;/P&gt;&lt;P&gt;all I'm able to do is get the title (what's marked in yellow).&lt;/P&gt;&lt;P&gt;I found that with "get XML" instead of "get Text" does give me also the names, but there is ALOT of data there and I hope there is an easier way&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="itzikd_0-1616677714256.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/31545i080BA9B8B09619DD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="itzikd_0-1616677714256.png" alt="itzikd_0-1616677714256.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 13:10:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-get-open-graphs-X-and-Y-values/m-p/371362#M62125</guid>
      <dc:creator>itzikd</dc:creator>
      <dc:date>2021-03-25T13:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: JSL - get open graphs X and Y values</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-get-open-graphs-X-and-Y-values/m-p/372668#M62256</link>
      <description>&lt;P&gt;Here is an approach that uses the JSL written by the platform (in this case, Graph Builder) to find the elements.I include it to illustrate the following:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;expr ( )&lt;/LI&gt;
&lt;LI&gt;name expr ( )&lt;/LI&gt;
&lt;LI&gt;arg ( )&lt;/LI&gt;
&lt;LI&gt;head ( )&lt;/LI&gt;
&lt;LI&gt;&amp;lt;&amp;lt; get scriptable object&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (this returns the Graph Builder object from which you obtain the script)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You'll want to read up on these in the scripting guide if you've not used them before. They're powerful but require some practice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since I have not put any conditionals in (you'd want to do that... check window names, etc.), do the following to make sure the script works as written below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Close current reports and graphs.&lt;/P&gt;
&lt;P&gt;2) Create a Graph Builder graph.&lt;/P&gt;
&lt;P&gt;3) Run the script below in a script window. (You could also wrap this in an external loop to cycle through more than one graph window. Again, this is just a skeletal script meant to illustrate the overall idea.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Brady&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

winList = Get Window List( Type( "reports" ) );

obj = winlist[1][Outline Box( 1 )] &amp;lt;&amp;lt; Get Scriptable Object;
script = obj &amp;lt;&amp;lt; get script;

i = 1;

//move through the script's arguments until you get to the Variables ( ) argument.
While( Head( exp = Arg( Name Expr( script ), i ) ) != Expr( Variables ), i++ );

xList = ylist = {};
nexp = name expr ( exp );       //optional; this allows us to type nexp instead of name expr ( exp ) in the code below.

//cycle through the arguments in the Variables ( ) section. If X ( ) or Y ( ) is 
//encountered, insert into the appropriate list.
For( i = 1, i &amp;lt;= N Arg( nexp ), i++,
	If( Head( var = Arg( nexp, i ) ) == Expr( X ), Insert Into( xList, Arg( Name Expr( var ), 1 ) ));
	If( Head( var = Arg( nexp, i ) ) == Expr( Y ), Insert Into( yList, Arg( Name Expr( var ), 1 ) ));
);
	
Show( xList, yList );
	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-jsl"&gt;
&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 15:06:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-get-open-graphs-X-and-Y-values/m-p/372668#M62256</guid>
      <dc:creator>brady_brady</dc:creator>
      <dc:date>2021-03-30T15:06:37Z</dc:date>
    </item>
  </channel>
</rss>

