Data visualization with SAS programming

Can Sgrender Have Hover Points?

Accepted Solution Solved
Reply
Super Contributor
Posts: 494
Accepted Solution

Can Sgrender Have Hover Points?

I’m working with a number of small graphs.  Some types of SAS line graph reports allow the user to hover over data points on the image and see the exact value of a point on the graph.  I noticed that this feature goes away when I resize images.  I also noticed that when I use sgrender to display a line graph that the hover feature only displays ‘The SGRender Procedure’. Is there a way to enable the hover feature using sgrender, preferably after resizing?


Accepted Solutions
Solution
‎01-06-2015 09:51 AM
SAS Super FREQ
Posts: 925

Re: Can Sgrender Have Hover Points?

If you use WIDTH and/or HEIGHT on the ODS GRAPHICS statement, the imagemap will be generated correctly. When you said "resizing", I thought you meant you were changing the image dimensions in an editor after the image was generated.

As for the TIP options, look in the GTL reference doc at the plot statements you are using. You will see options that start with TIP that will enable you to do the following:

1. Control the content of the tip (which variables are shown, in what order, even add a variable that is not used by the plot)

2. Control the tip labels

3. Set an alternate format for the values in the tip

View solution in original post


All Replies
SAS Super FREQ
Posts: 925

Re: Can Sgrender Have Hover Points?

Yes, there is. On the ODS GRAPHICS statement, specify the IMAGEMAP option:

ods graphics / imagemap;

Also, there are various TIP options per plot statement that enable you to control various aspects of the tip text.

Hope this helps!

Dan

SAS Super FREQ
Posts: 925

Re: Can Sgrender Have Hover Points?

Regarding the resizing question, if you change the size of the image after it is generated, then the imagemap will not be correct. It is better to determine your size in advance if possible.

Super Contributor
Posts: 494

Re: Can Sgrender Have Hover Points?

What sizing options can I use that will allow the image to be sized before it is generated?  I am using ods graphics / height=6in width=3in border=off; to resize the image. 

Can you recommend an article for tip options?  My goal is to show the value of each data mark.

Solution
‎01-06-2015 09:51 AM
SAS Super FREQ
Posts: 925

Re: Can Sgrender Have Hover Points?

If you use WIDTH and/or HEIGHT on the ODS GRAPHICS statement, the imagemap will be generated correctly. When you said "resizing", I thought you meant you were changing the image dimensions in an editor after the image was generated.

As for the TIP options, look in the GTL reference doc at the plot statements you are using. You will see options that start with TIP that will enable you to do the following:

1. Control the content of the tip (which variables are shown, in what order, even add a variable that is not used by the plot)

2. Control the tip labels

3. Set an alternate format for the values in the tip

Super Contributor
Posts: 494

Re: Can Sgrender Have Hover Points?

Creating tooltips for scatter plots with PROC SGPLOT - The DO Loop

The article below is a great example, I was able to find it by Googling keywords in your explanation.

Super Contributor
Posts: 494

Re: Can Sgrender Have Hover Points?

Is there a way to rename elements such as the x and the y in the series plot? So that it shows up right in the tooltip?  E.g.

seriesplot x=TWO_DIGIT_YEAR y=students_enrolled / group=Degree_Level  name='a' index=index display=all

Super Contributor
Posts: 494

Re: Can Sgrender Have Hover Points?

Below is how to rename a tooltip.

ROLENAME=(Year=ACADEMIC_PERIOD_DESC )

TIP=(Year Y) tiplabel=(Year='Academic Term' Y='Students Enrolled')

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 613 views
  • 6 likes
  • 2 in conversation