cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
Emma1
Level III

Hover label

Hello,

I would like to display a photo in my hover label when I click on a point of a graph (like in the file "Big class families", script "graph builder with pictures").

I would like to do the same thing but without the "Picture" column

Indeed, I have a database with a lot of lines and putting photos for each line would be too heavy

I would like to have a folder on my computer with all the photos, in “.jpg” format. These photos will have the same name as what is in the "name" column of my database

For example, Katie's photo will be named in my computer folder: "KATIE.jpg"

When I click on a point, I would like to display the corresponding image (which is in a folder on my computer, and not in an "image" column) thanks to the "name" column which is named from the same way as my photos

 

Can you help me please ?

For the moment, I can only open the folder with all my photos when I go over a point but it does’nt show me the photo that corresponds to the point in the hover label

 

Thank you 

33 REPLIES 33
nascif_jmp
Level VI

Re: Hover label

The only thing that is specific to JMP16 is the Thumbnail() attribute that allows you to make the thumbnail smaller.

I suspect that with the new way we are scaling down the image before displaying it on click you might not need it.
Emma1
Level III

Re: Hover label

I tested my script under JMP 15, I did it several times, and each time this error message appears (and JMP 15 closes) :

 

Capture4.PNG

 

Do you have an explanation ?
I had a message, which has already gone to technical support

Emma1
Level III

Re: Hover label

I tested the same script on JMP 15 on another computer and got the same error message, which is displayed as when clicking on the photo in the thumbnail

Have a good day

Emma1
Level III

Re: Hover label

Hello,

 

Here is my script:

 

 

Names Default To Here( 1 );

cwd = "...";

//dt = Open("....jmp");

//thumbSize = {400, 400};

scaleValue = 1.0;

gb = Graph Builder(
    Size( 604, 492 ),
    Variables( X( :Mois ), Y( :"A"n ) ),
    Elements( Points( X, Y, Legend( 4 ) ) )
);

gb = Graph Builder(
    Size( 604, 492 ),
    Variables( X( :Semaine ), Y( :B ), Group X( :Produit ) ),
    Elements( Points( X, Y, Legend( 5 ) ), Smoother( X, Y, Legend( 6 ) ) )
);

frames = (gb << report) << xpath( "//FrameBox" );

Show( N Items( frames ) );

frames << Set Graphlet(
    Picture(
        Picture Box(
            fileName = cwd || :Name( "Quantième +n°cuve" )[local:_firstRow] || ".jpg";

            Show( fileName );

            img = Open( fileName, "jpg" );
            img << scale( scaleValue );
            img;
        )
    ), 

//Thumbnail( thumbSize )

);

 

 

First of all, I didn't put "Thumbnail" in the script, because other users have JMP 15. The image still displays very well, in standard size thumbnail (170 x 200). "scalevalue" is used to display the photo of a certain size when you click on the thumbnail image? That's it ?

Then, I made a script to generate two charts
Images appear in the label only on the second (multipart) graphic, not on the first graphic.
However, in my second graphic the thumbnail problem is fixed, I have images in my labels on all parts.
I would like to find a way for the last part of the script (showing photos in the label) to be used for all previous graphics (there are actually a lot more than 2) so that the photos are in the thumbnails of all graphics. Is it possible ?

 

Thank you

Have a good day

Emma1
Level III

Re: Hover label

By reworking my script, I managed to reduce the size of the image even more when I click on the thumbnail. I kept the value of 0.25 which seems perfect to me
For my second problem, (the part of the script to display images that only applied to my second chart and not my first), I solved it.
I copy the part of the script that allows me to display the images in the thumbnails and I "paste" it below each of my graphics.
It weighed down my script but I only found this solution. Are you thinking of something else?
Thank you

nascif_jmp
Level VI

Re: Hover label

Hi @Emma1,

 

Good to see you making progress. Regarding the error message, my guess is that it was related to the use of the Thumbnail attribute which is not supported in JMP 15. It seems that you don't get an error message in JMP 15 once it was removed, is that correct? Also, in your code example, you commented out the Thumbnail() attribute but left the preceding comma. I would remove it too.

 

Regarding why you were only getting the configuration in your second graph in your first attempt, it is because you reused the 'gb' variable name. When you make the second call to 'gb = Graph Builder(...', you overwrote the reference to the first graph.

 

In your second attempt, things worked because you did the configuration before reusing the variable, so the reference to the first graph was still valid. But you are correct that the code duplication is unfortunate.

 

I am attaching an updated example that shows how to solve this problem using two JSL features:

  • Functions (to capture blocks of code so that they can be used in multiple places) and
  • Lists (to keep multiple references in a single variable, that can be iterated to have an action applied to all of them).

Using these techniques will allow you to keep your scripts easy to maintain  and organized.

You can learn more about them in the JMP Scripting Guide.

Françoise
Level V

Re: Hover label

Hi,

 

I've put in the script the same thumbnail for the hover label and for  all frames but I don't understand why I have two images with not the same size.

Someone has an explication?

 

best Capture image.JPGregards

nascif_jmp
Level VI

Re: Hover label

Hi @Françoise,

Does this graph uses a GroupX, GroupY or some other kind of grouping? If so, chances are you have configured one panel but not the other - the panels are independent under the covers.

A simple workaround is to remove the grouping, add your thumbnail customization, and only then add the grouping. That ensures that the customization will be applied equally to all panels.

nascif_jmp
Level VI

Re: Hover label

Although by the looks of the screenshot, the two points appear to be on the same panel. It is hard to say without looking at the script. If you can't post a copy here, please pass a copy to our tech support.

Also, since this issue is already marked as solved, I would suggest starting a new thread.

 
Françoise
Level V

Re: Hover label

This graph uses severzal grouping.

Even I remove it, it isn't good.

 

all the best