cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
cjackso21
Level I

Convert Date to a format used for chart reference lines

I want to take a list of dates from one table and use them as reference lines in an X by Y with Date as the X axis.   

The date formats are in this format from a table: 12/18/2023 14:14.  I would also like to add the label to each line from the same table.  In this case it is EPOXI MT25700-02

 

 

The script for the chart shows what I would like be able to add from a table to the chart as reference lines.   I would like to take the list of dates and lot numbers from a separate table and make them reference lines in a chart.

 

 

Bivariate(
	Y(:Value),
	X(:CreatedDateTime),
	Where(
		:ValueName == "Dispense Weight Chec" & :Site == "SAN" & :ProcessName ==
		"CLOUE Unload Station" & :EQNumber == "EQ-902280-001"
	),
	SendToReport(
		Dispatch(
			{},
			"CreatedDateTime",
			ScaleBox,
			{Add Ref Line(3785753640, "Solid", "Black", "EPOXI MT25700-02", 1)}
		),
		Dispatch({}, "Bivar Plot", FrameBox, {Frame Size(910, 194)})
	)
)
1 REPLY 1
txnelson
Super User

Re: Convert Date to a format used for chart reference lines

If this is the form of the graph that you want

txnelson_0-1703043603811.png

Here is the JSL that produces the above graph

Names Default To Here( 1 );
Data Table( "Weight Checks for JP" ) << Bivariate(
	Y( :Value ),
	X( :CreatedDateTime ),
	Where(
		:ValueName == "Dispense Weight Chec" & :Site == "SAN" & :ProcessName ==
		"CLOUE Unload Station" & :EQNumber == "EQ-902280-001"
	),
	SendToReport(
		Dispatch(
			{},
			"CreatedDateTime",
			ScaleBox,
			{Label Row( Label Orientation( "Angled" ) )}
		),
		Dispatch( {}, "Bivar Plot", FrameBox, {Frame Size( 910, 194 )} )
	)
);
BivR = Current Report()[Outline Box( 1 ), AxisBox( 2 )];
For( i = 1, i <= N Rows( Data Table( "Bottle Change Data" ) ), i++,
	BivR << Add Ref Line(
		Informat( Data Table( "Bottle Change Data" ):Date_Time[i], "m/d/y h:m" ),
		"Solid",
		"Black",
		Data Table( "Bottle Change Data" ):Description[i] || "  " ||
		Data Table( "Bottle Change Data" ):Part_Number[i],
		1
	)
);

Please use the <JSL> icon at the top of the Discussion Entry area when you are entering JSL.  It makes the reading of the code much easier

Jim