Data visualization with SAS programming

png image sizes in html with SAS/GRAPH

Reply
Frequent Contributor
Posts: 124

png image sizes in html with SAS/GRAPH

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


_CLIENT=StoredProcessService 9.3; JVM 1.6.0_24; Windows Server 2008 R2 (amd64) 6.1

_DEBUG=fields,log

_GRAFLOC=/sasweb/graph

_HTCOOK=JSESSIONID=D5FA66B10B5246406C189ECBB3070A2D.sasserver1

_HTUA=Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36

_METAFOLDER=/Epistat/SP/

_METAPERSON=nsihuser

_METAUSER=nsihuser@saspw

_PROGRAM=/Epistat/SP/EPISTAT

_REPLAY="&_URL?_sessionid=4C68A7FB-A3FE-4DE1-9369-573F3E6F51E1&_program=replay&_entry=&_TMPCAT.."

_REQMETH=POST

_RESULT=STREAM

_RMTADDR=192.168.0.68

_RMTHOST=192.168.0.68

_SECUREUSERNAME=nsihuser

_SRVNAME=stats.wiv-isp.be

_SRVPORT=443

_TMPCAT=APSWORK.TCAT168C

_URL=/SASStoredProcess/guest

_USERLOCALE=fr

_USERNAME=nsihuser@saspw

_VERSION=Version 9.3 (Build 474)

_WEBIN_FILE_COUNT=0

_WEBIN_STREAM=

_WEBIN_STREAM_COUNT=1


SAS Employee
Posts: 170

Re: png image sizes in html with SAS/GRAPH


Will goptions xpixels/yxixels work?

goptions xpixels=200 ypixels=200;

SAS Employee
Posts: 967

Re: png image sizes in html with SAS/GRAPH

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.

Frequent Contributor
Posts: 124

Re: png image sizes in html with SAS/GRAPH

@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 !

Ask a Question
Discussion stats
  • 3 replies
  • 655 views
  • 0 likes
  • 3 in conversation