Data visualization with SAS programming

ODS tagsets.htmlpanel. Is it possible convert Proc gplot Graphic to image(gif,png...)?

Reply
Regular Contributor
Posts: 160

ODS tagsets.htmlpanel. Is it possible convert Proc gplot Graphic to image(gif,png...)?

Hi, below is simple example of proc gplot that finally create html file test.html on some folder on server:

ODS tagsets.htmlpanel device=png body="...test.html";

proc gplot data=sashelp.class;

     plot height*weight / vaxis=axis1;

     axis1 label=(angle=90 "please change angle");

run;

ODS tagsets.htmlpanel close;


Graphic in html file is correctly presented only in IE browser, because ActiveX is mandatory for Charts representing.

But I'd like to open the Chart in Firefox, for example. So can I somehow convert this graphic(chart) to Image(png,gif) on fly, to make it possible see the Chart image in Firefox?Probably should be applied some ods options etc...

Thanks!

SAS Employee
Posts: 967

Re: ODS tagsets.htmlpanel. Is it possible convert Proc gplot Graphic to image(gif,png...)?

Try using 'goptions device=actximg;' rather than device=activex.

Or, if you're not really utilizing any of activex's special features, I'd suggest using device=png.

Regular Contributor
Posts: 160

Re: ODS tagsets.htmlpanel. Is it possible convert Proc gplot Graphic to image(gif,png...)?

Hi Robert,

Thanks for your advice, In my example I put png device as one of ODS option, but looks like I should initialize device option in goption statement.

So now in EG it works correct but when I try open it manually from server - Chart isn't presented there, becouse Chart image stored in EG SAS work session instead of folder on server that I mentioned in ODS body option...

So I will try to redirect(or just copy) chart image from WORK library to needed folder on server, or may be there are some better solution?

Thanks!

SAS Employee
Posts: 967

Re: ODS tagsets.htmlpanel. Is it possible convert Proc gplot Graphic to image(gif,png...)?

Hopefully someone familiar with EG will respond! Smiley Happy

Regular Contributor
Posts: 160

Re: ODS tagsets.htmlpanel. Is it possible convert Proc gplot Graphic to image(gif,png...)?

Hi again,

Actually this SAS code will run in STP session, so I'll be able use _webout instead of hardcoded html file on server, but I've just checked and looks like problem still actual...

Strange that png file with Chart stores in different folder that I set in body option of ODS statement.

But anyway, thanks for helpSmiley Happy!

Regular Contributor
Posts: 160

Re: ODS tagsets.htmlpanel. Is it possible convert Proc gplot Graphic to image(gif,png...)?

Hi Again,

I fixed the problem using ODS options path and file, also I made small corrections of target html file afterwords(Firefox form path to image differ than IE), -replace absolute path to png image to relative ... src="gplot.png".

Thanks!

Ask a Question
Discussion stats
  • 5 replies
  • 330 views
  • 0 likes
  • 2 in conversation