cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
Add a data-driven graph thumbnail to a graph tooltip

Problem

While looking at an aggregated data visualization, I want to get insights into the underlying data distribution by having the associated histogram displayed directly on the graph tooltip. 

Solution

1) Create an "expression" type column (so that its value is treated as an image);

2) Add a "formula" property to it using the JSL listed below.

3) Set the "Label" flag for this column (so that it is displayed in graph tooltips);

4) Create summary graphs like bar charts and treemaps, preferably aggregated by the same column used in the formula by-group definition.

5) Explore!

DistroOnBar.png


this_row = Row();
this_col = Column( "sex" );
this_cell = this_col[this_row];
dt = Current Data Table();
dt << clear select();
rpt = As Constant(
	Platform(
		dt,
		Graph Builder(
			Size( 256, 128 ),
			Show Control Panel( 0 ),
			Show Legend( 0 ),
			Variables( Y( :height ) ),
			Elements( Histogram( Y, Legend( 2 ) ) ),
			By( :sex )
		)
	)
);
xpt = "//OutlineBox[text() = 'Graph Builder sex=^this_cell^']";
L = rpt << xpath( Eval Insert( xpt ) );
L[1][1] << Get Picture();

 


 

JSL Cookbook

If you’re looking for a code snippet or design pattern that performs a common task for your JSL project, the JSL Cookbook is for you.

This knowledge base contains building blocks of JSL code that you can use to reduce the amount of coding you have to do yourself.

It's also a great place to learn from the experts how to use JSL in new ways, with best practices.