<?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 to detect changes in the order of the X-axis? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/886209#M104860</link>
    <description>&lt;P&gt;After I run your script, I disable Color for Bar (Right)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1752143438463.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/78041iFA4B4E87ACCB2794/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1752143438463.png" alt="jthi_0-1752143438463.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then I can modify Median (Column 6)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1752143473763.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/78042i81E6EE00A267D6DF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1752143473763.png" alt="jthi_1-1752143473763.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Jul 2025 10:31:46 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2025-07-10T10:31:46Z</dc:date>
    <item>
      <title>How to detect changes in the order of the X-axis?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/884292#M104813</link>
      <description>&lt;P&gt;&lt;SPAN&gt;How can I detect changes in the order of the X-axis? I am using the following JSL to mark the background color, but users can change the order of the X-axis as shown in the image below. If I cannot detect that the user has made this change to the graph, the previously marked background color area will not follow the new order and will not be updated. &lt;BR /&gt;For example, if I originally marked age 13 and the user changes the order to 'Ascending, Weight', I need to know that the user has triggered the order change so that the red marking can be correctly updated to the position of age 13, instead of staying fixed. &lt;BR /&gt;&lt;BR /&gt;What methods can I use to detect when the user changes the X-axis order, or how can I make the background color marking automatically change with the order?&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
GraphX =dt&amp;lt;&amp;lt; Graph Builder(
	Size( 534, 450 ),
	Show Control Panel( 0 ),
	Variables( X( :age ), Y( :weight ), Overlay( :sex ) ),
	Elements( Box Plot( X, Y, Legend( 4 ) ) )
);
rep1 = GraphX &amp;lt;&amp;lt; report;
frameboxDCRFH = rep1 &amp;lt;&amp;lt; XPath( "//FrameBox" );
frameboxDCRFH &amp;lt;&amp;lt; Add Graphics Script(
	Transparency( 0.1 );
	Fill Color( "Red" );
	
	Rect( 0.5, Y Origin() + Y Range(), 1.5, Y Origin(), 1 )
	
	;
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BabyDoragon_0-1752053161562.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/77967i18313CEDE0209D92/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BabyDoragon_0-1752053161562.png" alt="BabyDoragon_0-1752053161562.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 09:30:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/884292#M104813</guid>
      <dc:creator>BabyDoragon</dc:creator>
      <dc:date>2025-07-09T09:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to detect changes in the order of the X-axis?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/884308#M104815</link>
      <description>&lt;P&gt;I don't think we have access to such handlers so you would have to either take it into account in your graphic script or create the coloring using separate plot. One way of taking it into account with graphic script&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size(534, 492),
	Show Control Panel(0),
	Variables(X(:age), Y(:weight), Y(:Column 6, Position(1)), Overlay(:sex)),
	Elements(
		Box Plot(X, Y(1), Legend(4)),
		Points(X, Y(2), Overlay(0), Legend(6), Summary Statistic("Median"))
	)
);

fb = Report(gb)[FrameBox(1)];
fb &amp;lt;&amp;lt; Add Graphics Script(
	fb = Report(gb)[FrameBox(1)];
	barseg = fb &amp;lt;&amp;lt; Find Seg(MarkerSeg(1));
	xval = (barseg &amp;lt;&amp;lt; Get X Values)[1];
	Transparency(0.1);
	Fill Color("Red");
	Rect(xval - 0.5, Y Origin() + Y Range(), xval + 0.5, Y Origin(), 1)
);

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Formula for Column 6&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If(:age == 13,
	Col Median(:weight, :age),
	.
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Adding bar chart for the color&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1752056529103.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/77971i05713CF8DD550874/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1752056529103.png" alt="jthi_0-1752056529103.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1752056537005.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/77972i5BCB951C24BD8F59/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1752056537005.png" alt="jthi_1-1752056537005.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>Wed, 09 Jul 2025 10:22:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/884308#M104815</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-07-09T10:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to detect changes in the order of the X-axis?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/884316#M104817</link>
      <description>&lt;P&gt;And you can improve the plot by moving the "extra" column to right side&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1752059912299.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/77977i7B7B52FA2237F587/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1752059912299.png" alt="jthi_0-1752059912299.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

dt &amp;lt;&amp;lt; New Column("Column 6", Numeric, "Continuous", 
	Set Property(
		"Axis",
		{Show Major Ticks(0), Show Minor Ticks(0), Show Labels(0), Min(0.49),
		Max(0.5), Inc(0.2), Minor Ticks(0), Label Row(
			{Show Major Labels(0), Show Major Ticks(0), Show Minor Ticks(0)}
		)}
	),
	Formula(
		If(:age == 13,
			1
		,
			.
		)
	);
);
gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size(712, 621),
	Show Control Panel(0),
	Variables(X(:age), Y(:weight), Y(:Column 6, Position(1), Side("Right")), Overlay(:sex)),
	Elements(Bar(X, Y(2), Overlay(0), Legend(9), Summary Statistic("Median")), Box Plot(X, Y(1), Legend(4))),
	SendToReport(
		Dispatch({}, "400", ScaleBox, {Legend Model(9, Properties(0, {Fill Color(67), Transparency(0.2)}, Item ID("Median(Column 6)", 1)))}),
		Dispatch({}, "Y r title", TextEditBox, {Set Text("")}),
		Dispatch({}, "400", LegendBox, {Legend Position({9, [2], 4, [0, 1, -3, -3]})})
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jul 2025 11:21:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/884316#M104817</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-07-09T11:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to detect changes in the order of the X-axis?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/886177#M104851</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I hope to remove the axis on the right side. However, I only know how to manually modify the "show Properties" like in the figure below and set the Visibility to Hidden. How can I achieve this setting using JSL?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BabyDoragon_0-1752130288104.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/78029i172E90B494DB9946/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BabyDoragon_0-1752130288104.png" alt="BabyDoragon_0-1752130288104.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 06:52:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/886177#M104851</guid>
      <dc:creator>BabyDoragon</dc:creator>
      <dc:date>2025-07-10T06:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to detect changes in the order of the X-axis?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/886180#M104852</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I would also like to automatically remove the Median marker in the Legend Setting using JSL. The image below shows how to remove it manually. How can I hide it using JSL?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BabyDoragon_1-1752131548341.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/78031i731CB6F69150A047/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BabyDoragon_1-1752131548341.png" alt="BabyDoragon_1-1752131548341.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 07:13:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/886180#M104852</guid>
      <dc:creator>BabyDoragon</dc:creator>
      <dc:date>2025-07-10T07:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to detect changes in the order of the X-axis?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/886182#M104854</link>
      <description>&lt;P&gt;What are your axis settings? You can hide/remove most of the axis by using those. Median shouldn't add marker unless you are using points with the bar chart. If you mean the legend item and not marker, easiest is to hide it manually and copy the script.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 07:26:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/886182#M104854</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-07-10T07:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to detect changes in the order of the X-axis?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/886200#M104857</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;I have a derivative question. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;If the original graph already has a variable labeled 'Color' and the bar chart color cannot be controlled to be red, what should I do to fix it in order to maintain the red color? &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;The following JSL should address these two points: &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;1. Add color() to the variables&lt;/SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Variables(X(:age), Y(:weight), Y(:Column 6, Position(1), Side("Right")), Overlay(:sex),&lt;/SPAN&gt;&lt;FONT style="font-family: inherit;" color="#FF0000"&gt;Color("sex")&lt;/FONT&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;2. Change Fill color() to red:&amp;nbsp;&lt;/SPAN&gt;Dispatch({}, "400", ScaleBox, {Legend Model(9, Properties(0, {&lt;FONT color="#FF0000"&gt;Fill Color("Red")&lt;/FONT&gt;, Transparency(0.2)}, Item ID("Median(Column 6)", 1)))}),&lt;/DIV&gt;
&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BabyDoragon_0-1752142615780.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/78039iCC3EFFA19A7EF1DF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BabyDoragon_0-1752142615780.png" alt="BabyDoragon_0-1752142615780.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;DIV&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

dt &amp;lt;&amp;lt; New Column("Column 6", Numeric, "Continuous", 
	Set Property(
		"Axis",
		{Show Major Ticks(0), Show Minor Ticks(0), Show Labels(0), Min(0.49),
		Max(0.5), Inc(0.2), Minor Ticks(0), Label Row(
			{Show Major Labels(0), Show Major Ticks(0), Show Minor Ticks(0)}
		)}
	),
	Formula(
		If(:age == 13,
			1
		,
			.
		)
	);
);
gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size(712, 621),
	Show Control Panel(0),
	Variables(X(:age), Y(:weight), Y(:Column 6, Position(1), Side("Right")), Overlay(:sex),Color("sex")),
	Elements(Bar(X, Y(2), Overlay(0), Legend(9), Summary Statistic("Median")), Box Plot(X, Y(1), Legend(4))),
	SendToReport(
		Dispatch({}, "400", ScaleBox, {Legend Model(9, Properties(0, {Fill Color("Red"), Transparency(0.2)}, Item ID("Median(Column 6)", 1)))}),
		Dispatch({}, "Y r title", TextEditBox, {Set Text("")}),
		Dispatch({}, "400", LegendBox, {Legend Position({9, [2], 4, [0, 1, -3, -3]})})
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 10 Jul 2025 10:17:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/886200#M104857</guid>
      <dc:creator>BabyDoragon</dc:creator>
      <dc:date>2025-07-10T10:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to detect changes in the order of the X-axis?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/886203#M104858</link>
      <description>&lt;P&gt;Disable Color from bar charts variables and change the color?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 10:17:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/886203#M104858</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-07-10T10:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to detect changes in the order of the X-axis?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/886206#M104859</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I set the color of the bar in Customize Graph, but no changes have occurred.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Or should I set the color of the bar in another panel? I couldn't find any other place to set the bar color.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BabyDoragon_0-1752142886693.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/78040i6D78B8179BC73302/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BabyDoragon_0-1752142886693.png" alt="BabyDoragon_0-1752142886693.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 10:24:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/886206#M104859</guid>
      <dc:creator>BabyDoragon</dc:creator>
      <dc:date>2025-07-10T10:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to detect changes in the order of the X-axis?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/886209#M104860</link>
      <description>&lt;P&gt;After I run your script, I disable Color for Bar (Right)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1752143438463.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/78041iFA4B4E87ACCB2794/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1752143438463.png" alt="jthi_0-1752143438463.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then I can modify Median (Column 6)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_1-1752143473763.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/78042i81E6EE00A267D6DF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_1-1752143473763.png" alt="jthi_1-1752143473763.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jul 2025 10:31:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-detect-changes-in-the-order-of-the-X-axis/m-p/886209#M104860</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-07-10T10:31:46Z</dc:date>
    </item>
  </channel>
</rss>

