<?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 Draw reference lines for ordinal/nominal axis in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Draw-reference-lines-for-ordinal-nominal-axis/m-p/538882#M75996</link>
    <description>&lt;P&gt;Dear Community,&lt;/P&gt;
&lt;P&gt;I'm struggling a bit with drawing reference lines on an ordinal axis. There are great examples on how to draw reference lines on continuous axes, but it seems to be different for ordinal axes. So in the example below I cannot tell JMP to draw a reference line at age of 13, instead I need to find the position at the axis in the GraphBuilder (that is two: 13 is the second age value when ordering from low to high) and set the reference line for that position. So far ok.&lt;/P&gt;
&lt;P&gt;But I want to draw reference lines on many Graph Builder objects, that itself have local data filters, and thus have the same year e.g. 13 at different positions. You can try, if you exclude age=12 by local data filter, the the reference line is at the wrong position.&lt;/P&gt;
&lt;P&gt;So a better strategy would be for me to be able to get the values from the x-axis of the Graph Builder object, so I could correctly add a reference line at age=13 for each Graph Builder.&lt;/P&gt;
&lt;P&gt;In my real world example I have to set the reference line for each GraphBuilder in a dashboard with different filters at current calender week, that is given in a format of "YYYYWW".&lt;/P&gt;
&lt;P&gt;JMP16 / Pro on Win10.&lt;/P&gt;
&lt;P&gt;Any ideas? Thanks in advance&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 );
// test reference lines for ordinal/nominal axis

// Open table and make graph
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
gb_obj = dt &amp;lt;&amp;lt; graph builder( Show Control Panel( 0 ), variables( x( :age ), y( :weight ) ), Elements( bar( X, Y ) ) );

// get location of certain ordinal or nominal value from data table
refpos="13";
Summarize( dt, age_lst = by( :age ) );
label = Loc( age_lst, refpos );

// apply reference lines at different positions
Report( gb_obj )[AxisBox( 1 )] &amp;lt;&amp;lt; add ref line( Eval( label - 1 ), "Dotted", "Red", refpos, 3 );&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 11 Jun 2023 11:27:28 GMT</pubDate>
    <dc:creator>Georg</dc:creator>
    <dc:date>2023-06-11T11:27:28Z</dc:date>
    <item>
      <title>Draw reference lines for ordinal/nominal axis</title>
      <link>https://community.jmp.com/t5/Discussions/Draw-reference-lines-for-ordinal-nominal-axis/m-p/538882#M75996</link>
      <description>&lt;P&gt;Dear Community,&lt;/P&gt;
&lt;P&gt;I'm struggling a bit with drawing reference lines on an ordinal axis. There are great examples on how to draw reference lines on continuous axes, but it seems to be different for ordinal axes. So in the example below I cannot tell JMP to draw a reference line at age of 13, instead I need to find the position at the axis in the GraphBuilder (that is two: 13 is the second age value when ordering from low to high) and set the reference line for that position. So far ok.&lt;/P&gt;
&lt;P&gt;But I want to draw reference lines on many Graph Builder objects, that itself have local data filters, and thus have the same year e.g. 13 at different positions. You can try, if you exclude age=12 by local data filter, the the reference line is at the wrong position.&lt;/P&gt;
&lt;P&gt;So a better strategy would be for me to be able to get the values from the x-axis of the Graph Builder object, so I could correctly add a reference line at age=13 for each Graph Builder.&lt;/P&gt;
&lt;P&gt;In my real world example I have to set the reference line for each GraphBuilder in a dashboard with different filters at current calender week, that is given in a format of "YYYYWW".&lt;/P&gt;
&lt;P&gt;JMP16 / Pro on Win10.&lt;/P&gt;
&lt;P&gt;Any ideas? Thanks in advance&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 );
// test reference lines for ordinal/nominal axis

// Open table and make graph
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
gb_obj = dt &amp;lt;&amp;lt; graph builder( Show Control Panel( 0 ), variables( x( :age ), y( :weight ) ), Elements( bar( X, Y ) ) );

// get location of certain ordinal or nominal value from data table
refpos="13";
Summarize( dt, age_lst = by( :age ) );
label = Loc( age_lst, refpos );

// apply reference lines at different positions
Report( gb_obj )[AxisBox( 1 )] &amp;lt;&amp;lt; add ref line( Eval( label - 1 ), "Dotted", "Red", refpos, 3 );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:27:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Draw-reference-lines-for-ordinal-nominal-axis/m-p/538882#M75996</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2023-06-11T11:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Draw reference lines for ordinal/nominal axis</title>
      <link>https://community.jmp.com/t5/Discussions/Draw-reference-lines-for-ordinal-nominal-axis/m-p/538941#M75999</link>
      <description>&lt;P&gt;The actual axis values for your chart range from 0 to 3.&amp;nbsp; Open the Axis settings and you will see the values&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_0-1661896333931.png" style="width: 596px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/45104iD1E347FF671C5F7D/image-dimensions/596x274?v=v2" width="596" height="274" role="button" title="txnelson_0-1661896333931.png" alt="txnelson_0-1661896333931.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Therefore, to add a reference line on the chart, you need to convert to this scale.&amp;nbsp; Below is an Add Ref Line that works&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Report( gb_obj )[AxisBox( 1 )] &amp;lt;&amp;lt; add ref line( 1, "Dotted", Red, "Yes", 3 );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="txnelson_1-1661896477488.png" style="width: 599px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/45105i022B3BFDC4675182/image-dimensions/599x542?v=v2" width="599" height="542" role="button" title="txnelson_1-1661896477488.png" alt="txnelson_1-1661896477488.png" /&gt;&lt;/span&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;</description>
      <pubDate>Tue, 30 Aug 2022 21:54:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Draw-reference-lines-for-ordinal-nominal-axis/m-p/538941#M75999</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-08-30T21:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Draw reference lines for ordinal/nominal axis</title>
      <link>https://community.jmp.com/t5/Discussions/Draw-reference-lines-for-ordinal-nominal-axis/m-p/538975#M76009</link>
      <description>Thanks &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;, but it's Not my Problem to Set a reference line, this worked already in my above Script dynamically. My Problem is the scale Translation for many graph builder, with different data on x axis, when I want to Set a ref line at age 13 for All.</description>
      <pubDate>Wed, 31 Aug 2022 06:54:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Draw-reference-lines-for-ordinal-nominal-axis/m-p/538975#M76009</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2022-08-31T06:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Draw reference lines for ordinal/nominal axis</title>
      <link>https://community.jmp.com/t5/Discussions/Draw-reference-lines-for-ordinal-nominal-axis/m-p/539004#M76011</link>
      <description>&lt;P&gt;You might have to do some calculations based on the filters &lt;LI-MESSAGE title="Is there a method to get axis values from graph builder?" uid="274510" url="https://community.jmp.com/t5/Discussions/Is-there-a-method-to-get-axis-values-from-graph-builder/m-p/274510#U274510" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2022 07:49:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Draw-reference-lines-for-ordinal-nominal-axis/m-p/539004#M76011</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-08-31T07:49:28Z</dc:date>
    </item>
  </channel>
</rss>

