Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Level I

How can I import reference lines from a column to the X-axis



I have a large data set with a common time axis. I want to add a column with events that occurred, to display these events as a vertical reference line (on the X-axis). How can I do this? If I now make one graph, I need to manually copy all X-axis reference lines to another graph, I want an automated option to do this.

The events will add extra information regarding the trends observed and will help in the discussion when I show these trends to my team. The table below represents (simplified ofc.) my data set.




Date & TimeP1P2P3Events
27/09/2018 6:005110.5pump failure
27/09/2018 14:004180.2(empty)
27/09/2018 22:005150.4raw material shortage



Super User

Re: How can I import reference lines from a column to the X-axis

Here is a simple illustration of one way to do this:

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big" );

// Create reference line data table for the illustration
dtLines = New Table( "Lines",
	New Column( "HeightRefs", values( [52, 60, 66] ) ),
	New Column( "Labels", character, values( {"Age 10", "Age 14", "Age 18"} ) )

// Create the chart
Biv = dt << Bivariate( Y( :weight ), X( :height ) );

// Add the lines
For( i = 1, i <= N Rows( dtLines ), i++,
	Report( Biv )[AxisBox( 2 )] << add ref line( dtLines:HeightRefs[i], dtLines:Labels[i] )
Article Labels

    There are no labels assigned to this post.