BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mathias
Quartz | Level 8

Hi,

 

I have a stored process wich produces a lot different kind of charts / maps etc.

I wanted to increase the resolution of the png images in the HTML output so I modified the html dpi option with this :

ods html

  image_dpi=400

  device=png

  ;

 

It works good with ODS graphics : i.e. dpi is increased but the width and height of the image in html is not changed

<img alt="The SGPlot Procedure" src="/SASStoredProcess/guest?_sessionid=2C07BCBA-F2C7-419B-B89B-72B2289BFE69&_program=replay&_entry=APSWO..." style=" height: 480px; width: 640px;" border="0" class="c">

 

With SAS/GRAPH (pie charts, maps in my case), the DPI is increase but also the HTML height and width

<img alt="Pie chart of Pathogen" src="/SASStoredProcess/guest?_sessionid=28DB6ECF-0A2B-485C-8F82-5AF78E0C6668&_program=replay&_entry=APSWO..." style=" border-width: 0px; height: 2500px; width: 3333px;" border="0" class="c graph">

 

 

Is there a way to control the width and height in this HTML file?

Maybe in the style?

 

Thank you for your help!

 

 

Here are some clues that might be of importance:

I'm using SAS 9.3 in Enterprise Guide 5.1

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
mathias
Quartz | Level 8

Solution : 

 

	proc odstext; 
		p "<script>
			setTimeout(function(){ 
			  var el = document.getElementsByClassName('c graph')[0];
			  el.style.height = '';
			  el.style.width = '70%';
			}, 0);
		</script>";
	run;

View solution in original post

5 REPLIES 5
Darrell_sas
SAS Employee


Will goptions xpixels/yxixels work?

goptions xpixels=200 ypixels=200;

GraphGuy
Meteorite | Level 14

Mathias - could you re-state your question? Are you trying to change the size of your ods graphics (such as sgplot), or are you trying to change the resolution of your SAS/Graph (such as gmap, gplot, gchart, etc)?

Also, could you show all the code you're currently using to try to control the size & resolution of both kinds of graphs. Note that SAS/Graph and ODS Graphics are different in how they control these things ... and when you're using html output with dev=png and sas/graph procs, I don't think you can control the resolution of those.

mathias
Quartz | Level 8

@Darell

This produces a 200x200px png image displayed at 200x200px

goptions modifies the PNG image size. I would like to keep the same png image size, only change it's display size in html style.

@RobertAllisson

> could you re-state your question?

I'll try my best:

Lets say that I produce 2 plots in my STP :  an SGPLOT (ODS graphics) and a PROC GMAP (SAS/GRAPH).

When I declare

ods html image_dpi=400 ;

It changes the png sizes for both the graphs

- the sgplot png image is: 2666x2000

- the map png image is: 3333x2500

That's very good, it's exactly what I want.

The difference lays in the HTML style :

- the sgplot html img tag style is: 640x480

- the map html img tag style is: 3333x2500

(cf. complete img tags in my first post)

I prefer 640x480, which is more visible in my web browser.

Thus I'm looking for a method to change the SAS/GRAPH html img tag style width & height

> Are you trying to change the size of your ods graphics (such as sgplot), or are you trying to change the resolution of your SAS/Graph (such as gmap, gplot, gchart, etc)?

Only the HTML style width & height

> Also, could you show all the code you're currently using to try to control the size & resolution

%let _ODSDEST = html ;

%let _ODSSTYLE = wivisp1 ;

%let _ODSSTYLESHEET = ;

%let _GOPT_DEVICE=png;

ods html image_dpi=400 device=png ;

That's It I believe.

Many thanks !

mathias
Quartz | Level 8

Any solutions?

 

mathias
Quartz | Level 8

Solution : 

 

	proc odstext; 
		p "<script>
			setTimeout(function(){ 
			  var el = document.getElementsByClassName('c graph')[0];
			  el.style.height = '';
			  el.style.width = '70%';
			}, 0);
		</script>";
	run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 3279 views
  • 0 likes
  • 3 in conversation