<?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 make time duration responsive to graph axis limits? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-make-time-duration-responsive-to-graph-axis-limits/m-p/467413#M71140</link>
    <description>&lt;P&gt;The solution I'm going to propose will require formula, global data filter (this will affect the datatable) and some scripting. Idea is to use formula column as X-axis which will always re-calculate the duration based on the first NON-excluded row:&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("Date", Numeric, Continuous, Set Each Value(Today() + Row()));

dt &amp;lt;&amp;lt; New Column("TimeSinceStart", Numeric, Continuous, Set Each Value(:Date - :Date[1]));

dt &amp;lt;&amp;lt; New Column("TimeWithFormula",
	Numeric,
	"Continuous",
	Format("Best", 12),
	Formula(If(!Excluded(), :Date - Col Min(:Date, !Excluded()), .))
);

nw = New Window("",
	H List Box(
		dt &amp;lt;&amp;lt; Data Filter(
			Mode(Include(1)),
			Add Filter(columns(:Date))
		),
		gb = dt &amp;lt;&amp;lt; Graph Builder(
			Size(535, 457),
			Show Control Panel(0),
			Variables(X(:TimeWithFormula), Y(:weight)),
			Elements(Points(X, Y, Legend(3)), Smoother(X, Y, Legend(4)))
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There are other ways to do this, but this should be fairly simple option&lt;/P&gt;</description>
    <pubDate>Sun, 06 Mar 2022 17:00:07 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2022-03-06T17:00:07Z</dc:date>
    <item>
      <title>How to make time duration responsive to graph axis limits?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-time-duration-responsive-to-graph-axis-limits/m-p/467394#M71139</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a datatable that consists of:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;absolute date-time&lt;/LI&gt;&lt;LI&gt;duration in seconds from first timestamp&lt;/LI&gt;&lt;LI&gt;datapoints associated with each date-time&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I plot the datapoints I often place duration on the X-axis and then crop / filter the X-axis to a period of interest.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However when cropping the X-axis in the graph builder the duration no longer starts at "zero". What is the simplest way to always start the duration at time "zero" in the graph? I'd like to do this so the graph cleaner and easier to read.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it's possible to do this without modifying the underling data-table and simply change the axis display behavior that would be great. Otherwise I assume I might need to reference the graph window axis limits in the duration column formula - but after some searching I'm not seeing how to do to this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help or suggestions!&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:22:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-time-duration-responsive-to-graph-axis-limits/m-p/467394#M71139</guid>
      <dc:creator>sanford78AQH</dc:creator>
      <dc:date>2023-06-11T11:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to make time duration responsive to graph axis limits?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-make-time-duration-responsive-to-graph-axis-limits/m-p/467413#M71140</link>
      <description>&lt;P&gt;The solution I'm going to propose will require formula, global data filter (this will affect the datatable) and some scripting. Idea is to use formula column as X-axis which will always re-calculate the duration based on the first NON-excluded row:&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("Date", Numeric, Continuous, Set Each Value(Today() + Row()));

dt &amp;lt;&amp;lt; New Column("TimeSinceStart", Numeric, Continuous, Set Each Value(:Date - :Date[1]));

dt &amp;lt;&amp;lt; New Column("TimeWithFormula",
	Numeric,
	"Continuous",
	Format("Best", 12),
	Formula(If(!Excluded(), :Date - Col Min(:Date, !Excluded()), .))
);

nw = New Window("",
	H List Box(
		dt &amp;lt;&amp;lt; Data Filter(
			Mode(Include(1)),
			Add Filter(columns(:Date))
		),
		gb = dt &amp;lt;&amp;lt; Graph Builder(
			Size(535, 457),
			Show Control Panel(0),
			Variables(X(:TimeWithFormula), Y(:weight)),
			Elements(Points(X, Y, Legend(3)), Smoother(X, Y, Legend(4)))
		)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There are other ways to do this, but this should be fairly simple option&lt;/P&gt;</description>
      <pubDate>Sun, 06 Mar 2022 17:00:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-make-time-duration-responsive-to-graph-axis-limits/m-p/467413#M71140</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-03-06T17:00:07Z</dc:date>
    </item>
  </channel>
</rss>

