<?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 Add date and file name into any graph in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Add-date-and-file-name-into-any-graph/m-p/807188#M98604</link>
    <description>&lt;P&gt;Just wondering if anyone has written an addin or some script that will add the current date and file name (of the source data table) onto any graph/report generated?&lt;/P&gt;&lt;P&gt;I've turned on preferences&amp;lt;reports to make it appear at the top of the report window, but would like it actually on the graph so that when the these are copied and pasted into PP, for example, these details are clearly visible.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
    <pubDate>Mon, 21 Oct 2024 11:05:57 GMT</pubDate>
    <dc:creator>NBrammer</dc:creator>
    <dc:date>2024-10-21T11:05:57Z</dc:date>
    <item>
      <title>Add date and file name into any graph</title>
      <link>https://community.jmp.com/t5/Discussions/Add-date-and-file-name-into-any-graph/m-p/807188#M98604</link>
      <description>&lt;P&gt;Just wondering if anyone has written an addin or some script that will add the current date and file name (of the source data table) onto any graph/report generated?&lt;/P&gt;&lt;P&gt;I've turned on preferences&amp;lt;reports to make it appear at the top of the report window, but would like it actually on the graph so that when the these are copied and pasted into PP, for example, these details are clearly visible.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 11:05:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-date-and-file-name-into-any-graph/m-p/807188#M98604</guid>
      <dc:creator>NBrammer</dc:creator>
      <dc:date>2024-10-21T11:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Add date and file name into any graph</title>
      <link>https://community.jmp.com/t5/Discussions/Add-date-and-file-name-into-any-graph/m-p/807199#M98606</link>
      <description>&lt;P&gt;It isn't really that simple to create a script which would work with any graph/report.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The basic idea could be something like this but this makes already assumptions that you have a reference to the table and the analysis object. It also assumes that all frameboxes are based on the same table&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(
	Variables(X(:weight), Y(:height), Overlay(:sex)),
	Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
);


str = Char(As Date(Today())) || " " || (dt &amp;lt;&amp;lt; getname);

fbs = Report(gb) &amp;lt;&amp;lt; XPath("//FrameBox");
Eval(EvalExpr(
	fbs &amp;lt;&amp;lt; Add Graphics Script(
		Text Color("Red");
		Text(Right Justified, {X Origin() + X Range(), Y Origin()}, Expr(str));
	);
));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but figuring out which is the correct table for example can get fairly complicated.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 11:22:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-date-and-file-name-into-any-graph/m-p/807199#M98606</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-10-21T11:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Add date and file name into any graph</title>
      <link>https://community.jmp.com/t5/Discussions/Add-date-and-file-name-into-any-graph/m-p/807236#M98621</link>
      <description>&lt;P&gt;Without the references to the data table and to the plot, you can access the gb Object via the report / &lt;FONT face="courier new,courier"&gt;get scriptable object()&amp;nbsp;&lt;/FONT&gt; - and the data table via &lt;FONT face="courier new,courier"&gt;&amp;lt;&amp;lt; get data table()&lt;/FONT&gt;.&lt;BR /&gt;Maybe add some code to skip the LDF and Column Switcher ...&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 
/*
open("$SAMPLE_DATA/Big Class.jmp");

Graph Builder(
	Variables(X(:weight), Y(:height), Overlay(:sex)),
	Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
);
*/



fbs = current report() &amp;lt;&amp;lt; XPath("//FrameBox");
nfbs = N items(fbs); // add the info to the last FB

OBs= current report() &amp;lt;&amp;lt; XPath("//OutlineBox");
gb = OBs[1] &amp;lt;&amp;lt; get scriptable Object; // add some code to skip LDF and Column Switcher 

str = Char(As Date(Today())) || " " || ((gb &amp;lt;&amp;lt; get data table()) &amp;lt;&amp;lt; getname);

Eval(EvalExpr(
	fbs[nfbs] &amp;lt;&amp;lt; Add Graphics Script(
		Text Color("Red");
		Text(Right Justified, {X Origin() + X Range(), Y Origin()}, Expr(str));
	);
));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Oct 2024 13:30:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-date-and-file-name-into-any-graph/m-p/807236#M98621</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2024-10-21T13:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Add date and file name into any graph</title>
      <link>https://community.jmp.com/t5/Discussions/Add-date-and-file-name-into-any-graph/m-p/807254#M98628</link>
      <description>&lt;P&gt;Brilliant - thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2024 14:53:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Add-date-and-file-name-into-any-graph/m-p/807254#M98628</guid>
      <dc:creator>NBrammer</dc:creator>
      <dc:date>2024-10-21T14:53:57Z</dc:date>
    </item>
  </channel>
</rss>

