<?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 Re: How Do I Change Scale of X-Axis after using Graph Builder in JSL (and graphing approach question) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-Do-I-Change-Scale-of-X-Axis-after-using-Graph-Builder-in-JSL/m-p/513896#M74120</link>
    <description>&lt;P&gt;Is there a description how this can be done for Gradient Legend settings?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I tried&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Report( gb)[Legend Box(1)] &amp;lt;&amp;lt; Legend Model(&amp;nbsp;...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it didn't work&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jun 2022 17:09:40 GMT</pubDate>
    <dc:creator>hogi</dc:creator>
    <dc:date>2022-06-24T17:09:40Z</dc:date>
    <item>
      <title>How Do I Change Scale of X-Axis after using Graph Builder in JSL (and graphing approach question)</title>
      <link>https://community.jmp.com/t5/Discussions/How-Do-I-Change-Scale-of-X-Axis-after-using-Graph-Builder-in-JSL/m-p/348472#M59941</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm writing a script that will work with files that have a variety of columns, so I had to modify an example I found on here which concatenates the Graph Builder call based on the number of columns.&amp;nbsp; Despite being clumsy, it does seem to work, but my issue is that I then want to change the X-axis to log scale, change the limits, etc.&amp;nbsp; I tried a few approaches from the Scripting Index and examples, but none seemed to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would very much appreciate a pointer in the right direction on the axis settings, but if anybody has an idea of how to do initial graphing portion better, that would be great too, thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Current Data Table();
ColNameList = dt &amp;lt;&amp;lt; Get Column Names (continuous, string);

//Start with initial graph builder
GraphExpr = "
TestGraph = Graph Builder(
	Size( 534, 456 ),
	Show Control Panel( 0 ),
	
	Variables(";
		
//Add X Entry
GraphExpr = GraphExpr || "
		X( :Name( \!"" || ColNameList[1] || "\!") ),";

//Add the first Y entry
GraphExpr = GraphExpr || "
		Y( :Name( \!"" || ColNameList[2] || "\!") ),";

//Add the second Y entry
For( i = 3, i &amp;lt;= N items (ColNameList), i++,
GraphExpr = GraphExpr || "
		Y( :Name( \!"" || ColNameList[i] || "\!"), Position (1) ),";
);


//Close out Variables section
GraphExpr = GraphExpr || "
	),
	Elements( 
		Line( X, Y( 1 )";

//Build out the lines for all columns
For( i = 2, i &amp;lt;= N items (ColNameList), i++,
	GraphExpr = GraphExpr || ", Y( " || char(i) || " )"
);

GraphExpr = GraphExpr || ", Legend( 1 ) 
		) 
	) 
)";

eval(parse(GraphExpr));

TestGraph &amp;lt;&amp;lt; Show Legend (0);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:10:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-Do-I-Change-Scale-of-X-Axis-after-using-Graph-Builder-in-JSL/m-p/348472#M59941</guid>
      <dc:creator>ToddKeebler</dc:creator>
      <dc:date>2023-06-11T11:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Change Scale of X-Axis after using Graph Builder in JSL (and graphing approach question)</title>
      <link>https://community.jmp.com/t5/Discussions/How-Do-I-Change-Scale-of-X-Axis-after-using-Graph-Builder-in-JSL/m-p/348511#M59944</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This is indeed rather convoluted way to build a Graph Builder expression. You might want to look into the approach of defining your entire GB expression with "placeholders" (gbe = Expr (Graph Builder(...)); use the substitute function to replace your placeholders with column, variables, labels, etc.., and then use the Eval() function to generate the graph (sorry I don't have the time right now to provide more details)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For your specific question, if you assign your Graph Builder expression to a variable (e.g., gb = Graph Builder (...);) you can then use the approach below to update the axis in any way you need:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;gb = dt &amp;lt;&amp;lt; Graph Builder(
	Show Control Panel( 0 ),
	Variables(
		X( :age, Size( 23 ) ),
		Y( :height, Size( 37 ) ),
		Y( :weight, Position( 1 ), Size( 37 ), Side( "Right" ) )
	),
	Elements( Points( X, Y( 1 ), Legend( 1 ), Jitter( 1 ) ), Points( X, Y( 2 ), Legend( 3 ), Jitter( 1 ) ) )
);
framebox = Report( gb )[framebox( 1 )];
framebox &amp;lt;&amp;lt; Y Axis(
	Scale ("Log"),
	Add Ref Line( 61.25, "Solid", "Medium Dark Green" ),
	Show Major Grid( 1 ),
	Show Minor Grid( 1 ),
	Format( "Fixed Dec", 5, 2 ),
	Rotated Labels( "Perpendicular" )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;TS&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 06:31:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-Do-I-Change-Scale-of-X-Axis-after-using-Graph-Builder-in-JSL/m-p/348511#M59944</guid>
      <dc:creator>Thierry_S</dc:creator>
      <dc:date>2021-01-14T06:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Change Scale of X-Axis after using Graph Builder in JSL (and graphing approach question)</title>
      <link>https://community.jmp.com/t5/Discussions/How-Do-I-Change-Scale-of-X-Axis-after-using-Graph-Builder-in-JSL/m-p/348513#M59946</link>
      <description>&lt;P&gt;All of the messages that change an axis are available in the scripting index entry for AxisBox&lt;/P&gt;
&lt;P&gt;What you want to use, is&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;report(TestGraph)[AxisBox(2)] &amp;lt;&amp;lt; scale(log);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 06:40:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-Do-I-Change-Scale-of-X-Axis-after-using-Graph-Builder-in-JSL/m-p/348513#M59946</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-01-14T06:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Change Scale of X-Axis after using Graph Builder in JSL (and graphing approach question)</title>
      <link>https://community.jmp.com/t5/Discussions/How-Do-I-Change-Scale-of-X-Axis-after-using-Graph-Builder-in-JSL/m-p/348733#M59971</link>
      <description>&lt;P&gt;Hey Jim, thanks for the quick response on that.&amp;nbsp; That works well.&amp;nbsp; I didn't realize you needed to use report() to reference that graph item, I was just trying to use TestGraph[AxisBox(2)] &amp;lt;&amp;lt; scale(log)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Todd&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 19:56:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-Do-I-Change-Scale-of-X-Axis-after-using-Graph-Builder-in-JSL/m-p/348733#M59971</guid>
      <dc:creator>ToddKeebler</dc:creator>
      <dc:date>2021-01-14T19:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Change Scale of X-Axis after using Graph Builder in JSL (and graphing approach question)</title>
      <link>https://community.jmp.com/t5/Discussions/How-Do-I-Change-Scale-of-X-Axis-after-using-Graph-Builder-in-JSL/m-p/513896#M74120</link>
      <description>&lt;P&gt;Is there a description how this can be done for Gradient Legend settings?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I tried&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Report( gb)[Legend Box(1)] &amp;lt;&amp;lt; Legend Model(&amp;nbsp;...&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it didn't work&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 17:09:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-Do-I-Change-Scale-of-X-Axis-after-using-Graph-Builder-in-JSL/m-p/513896#M74120</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2022-06-24T17:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Change Scale of X-Axis after using Graph Builder in JSL (and graphing approach question)</title>
      <link>https://community.jmp.com/t5/Discussions/How-Do-I-Change-Scale-of-X-Axis-after-using-Graph-Builder-in-JSL/m-p/725101#M90909</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I have kind of similar question, on how to automate the X axis, which is time scale &amp;amp; I would like it to be automatically displayed the data from the last desired period.(n=7) for example.&lt;/P&gt;&lt;P&gt;Much appreciated for your helps.&lt;/P&gt;&lt;P&gt;Linh&lt;/P&gt;&lt;P&gt;My script as below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jmpfumbler_0-1708620751309.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/61382i0579EE5D784A68E4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jmpfumbler_0-1708620751309.png" alt="jmpfumbler_0-1708620751309.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 16:53:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-Do-I-Change-Scale-of-X-Axis-after-using-Graph-Builder-in-JSL/m-p/725101#M90909</guid>
      <dc:creator>jmpfumbler</dc:creator>
      <dc:date>2024-02-22T16:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Change Scale of X-Axis after using Graph Builder in JSL (and graphing approach question)</title>
      <link>https://community.jmp.com/t5/Discussions/How-Do-I-Change-Scale-of-X-Axis-after-using-Graph-Builder-in-JSL/m-p/725249#M90936</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/55185"&gt;@jmpfumbler&lt;/a&gt;&amp;nbsp;can you post the code using the &amp;lt;JSL&amp;gt; button rather than a picture?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 14:29:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-Do-I-Change-Scale-of-X-Axis-after-using-Graph-Builder-in-JSL/m-p/725249#M90936</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2024-02-23T14:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: How Do I Change Scale of X-Axis after using Graph Builder in JSL (and graphing approach question)</title>
      <link>https://community.jmp.com/t5/Discussions/How-Do-I-Change-Scale-of-X-Axis-after-using-Graph-Builder-in-JSL/m-p/725263#M90939</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Hi Pmroz,&lt;BR /&gt;Script with JSL, &lt;BR /&gt;Thank you,&lt;BR /&gt;
// → Data Table( "GSB" )
Local( {obj},
	obj = Data Table( "GSB" ) &amp;lt;&amp;lt;
	Graph Builder(
		Size( 604, 659 ),
		Variables(
			X(
				Transform Column(
					"Month Year[Date Measured]",
					Ordinal,
					Format( "m/y", 23 ),
					Formula(
						Date DMY(
							1,
							Month( :Date Measured ),
							Year( :Date Measured )
						)
					)
				)
			),
			Overlay( GSB Validation )
		),
		Elements(
			Bar(
				X,
				Legend( 11 ),
				Bar Style( "Stacked" ),
				Summary Statistic( "% of Factor" ),
				Label( "Label by Value" )
			)
		),
		Local Data Filter(
			Add Filter(
				columns(
					:"Inferred Value (Yes/No)"n,
					Transform Column(
						"Month Year[Date Measured]",
						Ordinal,
						Format( "m/y", 23 ),
						Formula(
							Date DMY(
								1,
								Month( :Date Measured ),
								Year( :Date Measured )
							)
						)
					)
				),
				Where( :"Inferred Value (Yes/No)"n == "Yes" ),
				Where(
					Transform Column(
						"Month Year[Date Measured]",
						Ordinal,
						Format( "m/y", 23 ),
						Formula(
							Date DMY(
								1,
								Month( :Date Measured ),
								Year( :Date Measured )
							)
						)
					) == {3755376000, 3758054400, 3760473600, 3763152000, 3765744000,
					3768422400, 3771014400, 3773692800, 3776371200, 3778963200,
					3781641600}
				),
				Display(
					Transform Column(
						"Month Year[Date Measured]",
						Ordinal,
						Format( "m/y", 23 ),
						Formula(
							Date DMY(
								1,
								Month( :Date Measured ),
								Year( :Date Measured )
							)
						)
					),
					N Items( 15 )
				)
			)
		),
		SendToReport(
			Dispatch(
				{},
				"graph title",
				TextEditBox,
				{Set Text( "Monthly GSB Validation (%)" )}
			),
			Dispatch( {}, "Y title", TextEditBox, {Set Text( "%" )} ),
			Dispatch( {}, "Where((Inferred Value (Yes", TextBox, {Hide( 1 )} )
		)
	);
	obj &amp;lt;&amp;lt; Save Script to Data Table(
		"Monthly GSB Validation (%)", &amp;lt;&amp;lt;Replace( 1 ), &amp;lt;&amp;lt;Prompt( 0 )
	);
	obj &amp;lt;&amp;lt; Close Window;
);
Graph Builder(
	Transform Column(
		"Year Week[Date Measured]",
		Character,
		Formula(
			Local(
				{w = Week Of Year( :Date Measured, 3 ), y = Year( :Date Measured ),
				m = Month( :Date Measured )},
				If( Is Missing( :Date Measured ),
					"",
					Char( If( m / w &amp;gt;= 12, y + 1, w / m &amp;gt;= 52, y - 1, y ) ) ||
					If( w &amp;gt;= 10, "W", "W0" ) || Char( w )
				)
			)
		)
	),
	Size( 570, 619 ),
	Variables( X( :"Year Week[Date Measured]"n ), Overlay( :Best product ) ),
	Elements(
		Bar(
			X,
			Legend( 2 ),
			Bar Style( "Stacked" ),
			Summary Statistic( "% of Factor" ),
			Label( "Label by Value" )
		)
	),
	Local Data Filter(
		Add Filter(
			columns( :"Year Week[Date Measured]"n ),
			Where(
				:"Year Week[Date Measured]"n == {"2023W48", "2023W49", "2023W50",
				"2023W51", "2023W52", "2024W01", "2024W02", "2024W03", "2024W04",
				"2024W05", "2024W06", "2024W07", "2024W08"}
			),
			Display(
				:"Year Week[Date Measured]"n,
				N Items( 15 ),
				Find( Set Text( "" ) )
			)
		)
	),
	SendToReport(
		Dispatch(
			{},
			"Where(Year Week[Date Measured] = 2023W48, 2023W49, 2023W50, 2023W51, 2023W52, 2024W01, 2024W02, 2024W03, 2024W04, 2024W05, 2024W06, 2024W07, 2024W08)",
			TextBox,
			{Hide( 1 )}
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Feb 2024 14:49:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-Do-I-Change-Scale-of-X-Axis-after-using-Graph-Builder-in-JSL/m-p/725263#M90939</guid>
      <dc:creator>jmpfumbler</dc:creator>
      <dc:date>2024-02-23T14:49:22Z</dc:date>
    </item>
  </channel>
</rss>

