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

I want the chart to be visible in an HTML page, but only get a tiny icon in the upper left corner in the HTML file, labeled "The SGPANEL Procedure".  I'm on Linux, SAS 9.4 TS1M3.

 

My code:

 

     ods html file="&outdir/&sgplot_report_file";
    *********************************************************;
    * Plot quantities by categories;
    *********************************************************;
    title "&wfs_csv_file";
    title2   height=7pt "%sysfunc(today(),date9.), %sysfunc(time(),hhmm5.)";

    proc sgpanel data=work.sgplot_prep;
        label orig_face = "Orig Face"
              holding = "Holding";
        panelby agency / columns=3;
        rowaxis  values=(-20000 to 20000 by 5000)
                 tickvalueformat=comma7.
                 offsetmin=0.05
                 offsetmax=0.05
                 valueshint
                 label="$Million";
        vbar security_type /response = orig_face;
        vbar security_type /response = holding  transparency=0.50;
    run;

    ods html close;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
     ods html5 file="&outdir/&sgplot_report_file";
    *********************************************************;
    * Plot quantities by categories;
    *********************************************************;
    title "&wfs_csv_file";
    title2   height=7pt "%sysfunc(today(),date9.), %sysfunc(time(),hhmm5.)";

    proc sgpanel data=work.sgplot_prep;
        label orig_face = "Orig Face"
              holding = "Holding";
        panelby agency / columns=3;
        rowaxis  values=(-20000 to 20000 by 5000)
                 tickvalueformat=comma7.
                 offsetmin=0.05
                 offsetmax=0.05
                 valueshint
                 label="$Million";
        vbar security_type /response = orig_face;
        vbar security_type /response = holding  transparency=0.50;
    run;

    ods html5 close;

Does this work?

View solution in original post

9 REPLIES 9
Reeza
Super User

Try HTML5 instead?I'm fairly certain that embeds the images.

 

In HTML files images are stored somewhere else and reference, if you check the log it may indicate where, but you can also specify the path in the ODS HTML statements or make sure you keep the file and the images together. 

 

HTML5 is a much quicker fix 🙂

 


@DougZ wrote:

I want the chart to be visible in an HTML page, but only get a tiny icon in the upper left corner in the HTML file, labeled "The SGPANEL Procedure".  I'm on Linux, SAS 9.4 TS1M3.

 

My code:

 

     ods html file="&outdir/&sgplot_report_file";
    *********************************************************;
    * Plot quantities by categories;
    *********************************************************;
    title "&wfs_csv_file";
    title2   height=7pt "%sysfunc(today(),date9.), %sysfunc(time(),hhmm5.)";

    proc sgpanel data=work.sgplot_prep;
        label orig_face = "Orig Face"
              holding = "Holding";
        panelby agency / columns=3;
        rowaxis  values=(-20000 to 20000 by 5000)
                 tickvalueformat=comma7.
                 offsetmin=0.05
                 offsetmax=0.05
                 valueshint
                 label="$Million";
        vbar security_type /response = orig_face;
        vbar security_type /response = holding  transparency=0.50;
    run;

    ods html close;

 

 


 

 

DougZ
Obsidian | Level 7

Reeza, how do I specify HTML5 for something like this?

Reeza
Super User
     ods html5 file="&outdir/&sgplot_report_file";
    *********************************************************;
    * Plot quantities by categories;
    *********************************************************;
    title "&wfs_csv_file";
    title2   height=7pt "%sysfunc(today(),date9.), %sysfunc(time(),hhmm5.)";

    proc sgpanel data=work.sgplot_prep;
        label orig_face = "Orig Face"
              holding = "Holding";
        panelby agency / columns=3;
        rowaxis  values=(-20000 to 20000 by 5000)
                 tickvalueformat=comma7.
                 offsetmin=0.05
                 offsetmax=0.05
                 valueshint
                 label="$Million";
        vbar security_type /response = orig_face;
        vbar security_type /response = holding  transparency=0.50;
    run;

    ods html5 close;

Does this work?

DanH_sas
SAS Super FREQ

The problem is in your file specification. For HTML output, don't put the path in the FILE option. Also, you typically do not want the path to be written to the SRC option on the <img> tag, unless you are creating an directory structure for your HTML output. Therefore, I think this specification might work best for you:

 

ods html path="&outdir" (url=none) file="&sgplot_report_file";

 

Hope this helps!

Dan 

DougZ
Obsidian | Level 7

sgpanel_msg.PNGThanks Dan - just pasted your ods line into the code and ran, but got the same result.

DanH_sas
SAS Super FREQ

Is the separate image being created?

DougZ
Obsidian | Level 7

Dan - a separate png file was created, but the HTML page had just the icon in the upper left and the label.  However, I did combine both your ODS line suggestion and Reeza's HTML5 suggestion, and it works now!  THANKS to you and Reeza.Capture.PNG

DanH_sas
SAS Super FREQ

For completeness, let me explain why HTML5 is working for you. By default in HTML5 output, ODS Graphics is generated as an inlined SVG output instead of an image (which can also be inlined with HTML5 using an option). Therefore, the separate PATH and (URL=NONE) had no effect on the graph output -- just on where the HTML file was written. I'm still curious as to why the other statement did not put the information in your SRC option of your <img> tag. Do you happen to still have that file around? If so, can you post the <img> tag so that I can see what was written in the SRC option?

 

Thanks!

Dan

DougZ
Obsidian | Level 7

Reeza - pls see my message to Dan... your suggestion + his suggestion together worked.  THANK YOU!

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
  • 9 replies
  • 1304 views
  • 8 likes
  • 3 in conversation