Choose Language Hide Translation Bar
Highlighted
Chris_Rodrigues
Level III

Add Annotations to Graph from a text data column?

Is there a way to have JMP add annotations to a graph from a text column?

 

I have a large data table with time-series data.  I would like to create a column called "comments" that contains unstructured text data.  This column would be mostly empty, but when a "significant event" occurs a few words would be entered to describe what was happening at that time.

 

Then, when I am looking at time series data on a platform like Graph Builder, I would like to use this comments column to dynamically add annotations at the timestamps that have comments entered.  That way, when I look at a different time period in graph builder, it only shows the annotations that are relevant for that time period.

 

I'd like to be able to turn the annotation display on and off.  Perhaps show some kind of indicator symbol on the graph, and when I move the mouse over the symbol it displays the comment.  Or alternatively, highlight the points that have annotations at that timestamp, and display the comment in the context menu on mouse-over of that data point.  See attached picture.

 

Has anyone ever tried to do something like this with JMP?  Maybe it's possible with some creative use of JSL scripting?  Or by assigning the Comments column as a Color or Size variable on the graph?  Ideas welcome.

 Graph Builder annotations example.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
pmroz
Super User

Re: Add Annotations to Graph from a text data column?

Turn on the label attribute for your comments column.  When you hover over a point the comment will appear.  Move the mouse into the comment box and click the thumbtack to make the comment permanent.

gbcomments.png

New Table( "Test GB Comments", Add Rows( 4 ),
	New Script(
		"Y vs. X", Graph Builder(
			Size( 517, 452 ), Show Control Panel( 0 ),
			Variables( X( :X ), Y( :Y ) ),
			Elements( Points( X, Y, Legend( 3 ) ), Line( X, Y, Legend( 5 ) ) )
		)
	),
	New Column( "X", Numeric, "Continuous", Format( "Best", 12 ),
		Set Values( [1, 2, 3, 4] ) ),
	New Column( "Y", Numeric, "Continuous", Format( "Best", 12 ),
		Set Values( [2, 5, 1, 2] ) ),
	New Column( "Comments", Character, "Nominal", 
		Set Values( {"", "Too high", "Too low", ""} ) ),
	Set Label Columns( :Comments )	// This will enable "hover" comments in the graph
);

 

View solution in original post

3 REPLIES 3
Highlighted
pmroz
Super User

Re: Add Annotations to Graph from a text data column?

Turn on the label attribute for your comments column.  When you hover over a point the comment will appear.  Move the mouse into the comment box and click the thumbtack to make the comment permanent.

gbcomments.png

New Table( "Test GB Comments", Add Rows( 4 ),
	New Script(
		"Y vs. X", Graph Builder(
			Size( 517, 452 ), Show Control Panel( 0 ),
			Variables( X( :X ), Y( :Y ) ),
			Elements( Points( X, Y, Legend( 3 ) ), Line( X, Y, Legend( 5 ) ) )
		)
	),
	New Column( "X", Numeric, "Continuous", Format( "Best", 12 ),
		Set Values( [1, 2, 3, 4] ) ),
	New Column( "Y", Numeric, "Continuous", Format( "Best", 12 ),
		Set Values( [2, 5, 1, 2] ) ),
	New Column( "Comments", Character, "Nominal", 
		Set Values( {"", "Too high", "Too low", ""} ) ),
	Set Label Columns( :Comments )	// This will enable "hover" comments in the graph
);

 

View solution in original post

Highlighted
kwmcm
Level II

Re: Add Annotations to Graph from a text data column?

Hi, I know this is a few years old, but what if you have multiple comments you want pinned to the graph? It might get overwhelming and some lay on top of others.
Any suggestions there? Can they be minimized?
Highlighted
Chris_Rodrigues
Level III

Re: Add Annotations to Graph from a text data column?

@kwmcm You can turn on Label for multiple columns.  Every column selected as a Label will appear in the mouseover tooltip.

 

Chris_Rodrigues_0-1594996632641.png

 

Article Labels

    There are no labels assigned to this post.