<?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:  add reference lines to Graph Builder Report depending on value of local data filter in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-add-reference-lines-to-Graph-Builder-Report-depending-on/m-p/548597#M76533</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;GObj = Graph Builder(
	Size(1221, 652),
	Show Control Panel(0),
	Variables(X(:Date), Y(:Close_s)),
	Elements(Box Plot(X, Y, Legend(5))),
	Local Data Filter(Add Filter(columns(:Date, :Name), Where(:Date &amp;gt;= 01Jun2022), Where(:Name == "Anglo American"))),
	SendToReport(
		Dispatch(
			{},
			"Graph Builder",
			OutlineBox,
			{Set Title("Variability Plot Low Close and High values for the day"), Image Export Display(Normal)}
		),
		Dispatch(
			{}, "Close_s",
			ScaleBox// {Min( 100000 ), Max( 200000 ), Inc( 50000 ), Minor Ticks( 4 )
			// Add Ref Line( 130000, "Solid", "Dark Red", "bought", 1 )}
		),
		Dispatch({}, "graph title", TextEditBox, {Set Text("Low, Close &amp;amp; High against date")})
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would like to add a reference line depending on the :name value in the data filter.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can programmatically add a reference line and remove the line when needed.&amp;nbsp; But the reference line must depends on the :name value of the data filter.&lt;/P&gt;
&lt;P&gt;I will have a Reference line table with a :Name column and reference line values that I can use to match :Name value in data filter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;DateValue = Date MDY(07, 12, 2022);
Report(GObj)[AxisBox(1)] &amp;lt;&amp;lt; {Add Ref Line(DateValue, "Solid", "Blue", "Date Bought", 1)};
Report(GObj)[AxisBox(2)] &amp;lt;&amp;lt; {Add Ref Line(130000, "Solid", "Green", "Value Bought", 1)};&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 11 Jun 2023 11:28:00 GMT</pubDate>
    <dc:creator>HansD</dc:creator>
    <dc:date>2023-06-11T11:28:00Z</dc:date>
    <item>
      <title>JSL:  add reference lines to Graph Builder Report depending on value of local data filter</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-add-reference-lines-to-Graph-Builder-Report-depending-on/m-p/548597#M76533</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;GObj = Graph Builder(
	Size(1221, 652),
	Show Control Panel(0),
	Variables(X(:Date), Y(:Close_s)),
	Elements(Box Plot(X, Y, Legend(5))),
	Local Data Filter(Add Filter(columns(:Date, :Name), Where(:Date &amp;gt;= 01Jun2022), Where(:Name == "Anglo American"))),
	SendToReport(
		Dispatch(
			{},
			"Graph Builder",
			OutlineBox,
			{Set Title("Variability Plot Low Close and High values for the day"), Image Export Display(Normal)}
		),
		Dispatch(
			{}, "Close_s",
			ScaleBox// {Min( 100000 ), Max( 200000 ), Inc( 50000 ), Minor Ticks( 4 )
			// Add Ref Line( 130000, "Solid", "Dark Red", "bought", 1 )}
		),
		Dispatch({}, "graph title", TextEditBox, {Set Text("Low, Close &amp;amp; High against date")})
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would like to add a reference line depending on the :name value in the data filter.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can programmatically add a reference line and remove the line when needed.&amp;nbsp; But the reference line must depends on the :name value of the data filter.&lt;/P&gt;
&lt;P&gt;I will have a Reference line table with a :Name column and reference line values that I can use to match :Name value in data filter&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;DateValue = Date MDY(07, 12, 2022);
Report(GObj)[AxisBox(1)] &amp;lt;&amp;lt; {Add Ref Line(DateValue, "Solid", "Blue", "Date Bought", 1)};
Report(GObj)[AxisBox(2)] &amp;lt;&amp;lt; {Add Ref Line(130000, "Solid", "Green", "Value Bought", 1)};&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:28:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-add-reference-lines-to-Graph-Builder-Report-depending-on/m-p/548597#M76533</guid>
      <dc:creator>HansD</dc:creator>
      <dc:date>2023-06-11T11:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: JSL:  add reference lines to Graph Builder Report depending on value of local data filter</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-add-reference-lines-to-Graph-Builder-Report-depending-on/m-p/548624#M76535</link>
      <description>&lt;P&gt;If you have reference line table, you could add the reference line column from that to graph builder as Line plot (join or use virtual join to combine data tables).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1663941809499.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/45726iF566C01A7D04F087/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1663941809499.png" alt="jthi_0-1663941809499.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example as script:&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("RefLine", Numeric, Continuous, &amp;lt;&amp;lt; Set Each Value(
	If(:sex == "F",
		50
	,
		60
	);
));

gb = dt &amp;lt;&amp;lt; Graph Builder(
	Size(542, 587),
	Show Control Panel(0),
	Variables(X(:weight), Y(:height), Y(:RefLine, Position(1)), Group X(:sex)),
	Elements(Points(X, Y(1), Legend(3)), Line(Y(2), Legend(7))),
	Local Data Filter(Add Filter(columns(:sex), Where(:sex == "F"))),
	SendToReport(
		Dispatch({"Points"}, "", OutlineBox, {Close(0)}),
		Dispatch({"Line"}, "", OutlineBox, {Close(0)})
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If this won't work other (there are more than two) would be to use Filter Change Handler to trigger the plotting. See Scripting Index for examples&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 14:05:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-add-reference-lines-to-Graph-Builder-Report-depending-on/m-p/548624#M76535</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-09-23T14:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: JSL:  add reference lines to Graph Builder Report depending on value of local data filter</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-add-reference-lines-to-Graph-Builder-Report-depending-on/m-p/548918#M76558</link>
      <description>&lt;P&gt;Hi Jthi, thanks for your fast response and solution - I tried your solutions and it works fine.&amp;nbsp; I will accept this as a solution.&amp;nbsp; I will investigate your suggested Filter Change Handler further.&amp;nbsp; I want to a increase the number of reference lines under certain circumstances.&amp;nbsp; Regards Hans&lt;/P&gt;</description>
      <pubDate>Sun, 25 Sep 2022 10:46:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-add-reference-lines-to-Graph-Builder-Report-depending-on/m-p/548918#M76558</guid>
      <dc:creator>HansD</dc:creator>
      <dc:date>2022-09-25T10:46:45Z</dc:date>
    </item>
  </channel>
</rss>

