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

Hello,

I'm using ODS html to produce completely static html reports ( text/tables/images) that a manager access through a link ( sample  link   )

The problem is that each manager uses a different laptop/desktop screen size/resolution and what happens is that on smaller sizes/resolution the report tends to badly overflow the screen edges

Any idea for a non expert related web issues?

Thanks

Abe

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

I'm not sure of your SAS version, but a great solution for your situation is to generate the output as SVG in the HTML page instead of an image. That way, the contents will resize to the size of the browser container. Here is a simple example for you to try:

ods html file="test.html";

ods graphics / imagefmt=svg;

proc sgplot data=sashelp.class;

vbar age;

run;

ods html close;

Hope this helps!

Dan

View solution in original post

14 REPLIES 14
GraphGuy
Meteorite | Level 14

With SAS/Graph, the only 2 solutions I see are ...

1) Create the graphs so they will fit on the smallest screen.

2) Create multiple versions of the reports, to accommodate different screen sizes.

ballardw
Super User

Would another export format such as PDF or RTF be acceptable? Those folks should be used to viewing other files than html that don't try to scale as much auotmatically.


EzPaste
Calcite | Level 5

No. The ask for html

Abe

DanH_sas
SAS Super FREQ

I'm not sure of your SAS version, but a great solution for your situation is to generate the output as SVG in the HTML page instead of an image. That way, the contents will resize to the size of the browser container. Here is a simple example for you to try:

ods html file="test.html";

ods graphics / imagefmt=svg;

proc sgplot data=sashelp.class;

vbar age;

run;

ods html close;

Hope this helps!

Dan

EzPaste
Calcite | Level 5

Extremely promising! Thanks

EzPaste
Calcite | Level 5

Hi,

I am facing an issue with the svg format. Axis seems to start always at 0 no mater the min and max axis statement (sgplot); For many situations , it is not practical. Any idea?

Thanks again

Abe

DanH_sas
SAS Super FREQ

This is not a function of svg -- it is probably just a minor coding issue. Can you send a snippet of code showing the graph you are trying to create?

Thanks!

Dan

EzPaste
Calcite | Level 5

Here it is. Thanks!

ODS GRAPHICS / RESET IMAGENAME = 'eee106' IMAGEFMT =svg   noborder    ;

ods html file="eee106.html"  path="C:\"  gpath="C:\Graphs" (url="Graphs/") nogtitle  style=normal       ;

proc sgplot data=IndicAvgVsOthers ;

   hbar  itemName/ STAT= mean group=entity   response=score   groupdisplay=cluster DATALABEL transparency=0.1 nooutline  ;

     xaxis  MAX= 5 MIN=2 grid display=(nolabel ) grid;

   keylegend / title='';

   format score 5.2;

yaxis display=(nolabel noticks) discreteorder=data valueattrs=(size=11) grid;

run;

ods html close;

Jay54
Meteorite | Level 14

It is harder to diagnose without some data.  The code wants to find good round numbers for the axis.  Adding a XAXIS VALUES option that includes your min and max values and other values helped with sashelp.cars.

EzPaste
Calcite | Level 5

I've tried also with sashelp.class but continue to get the below image

ods html file="c:/test.html"     gpath="c:/graphs";

ods graphics / imagefmt=svg;

proc sgplot data=sashelp.class;

hbar  name/ STAT= mean group=sex   response=Weight   groupdisplay=cluster DATALABEL transparency=0.1 nooutline name="MYCHART"  barwidth=1;

xaxis min=40;

proc print data=sashelp.class;;

run;

ods html close;

24-08-2013 20-43-00.png

Jay54
Meteorite | Level 14

This is correct.  X axis min is 40.  There is no tick and value at '40' because the computed tick interval is 25.  You can change that by setting the VALUES option.  Note VALUESHINT option.

hbar  name/ STAT= mean group=sex   response=Weight  

      groupdisplay=cluster DATALABEL transparency=0.1 nooutline barwidth=1;

xaxis min=40 values=(40 to 150 by 20) valueshint;

run;

EZPaste.pngproc sgplot data=sashelp.class;

EzPaste
Calcite | Level 5

I use your code but continue to get the incorrect chart on sas 9.3

Any clue?

Abe

Jay54
Meteorite | Level 14

I just used your code and changed the XAXIS statement.  Also, the image you attached has a weird bar color extending to underneath the tick values on the Y axis.  I don't know what is causing that.  It is easier to help if you include your full program with code and data. 

Tom
Super User Tom
Super User

That code worked for me on SAS 9.3 on Unix.  I took out the PROC PRINT but added a RUN to close the PROC SGPLOT.

What browser are you using?

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 14 replies
  • 2308 views
  • 6 likes
  • 6 in conversation