Data visualization with SAS programming

text from annotations in gchart importing as curves in cgm file

New Contributor
Posts: 2

text from annotations in gchart importing as curves in cgm file

I just moved from SAS 9.3 to SAS 9.4 and I'm trying to export a graph from proc gchart to a cgm file that I import into CorelDraw X5. I had been using device cgmlt97l but isn't available in 9.4 so I'm using cgmof97l instead. The graph is looking OK when it is imported into CorelDraw, but text from the annotations is curves instead of a font. Text from the rest of the chart in coming in as Helvetica. I'm pretty sure that it all came in as text before. Can anyone tell me what I need to change to get all the text to come in as text so I can manipulate it in CorelDraw as text? I’ve attached the three data files I am using and the graph I made last year with SAS 9.3 and CorelDraw X5 and I’ve included my code below. My operating system is Windows 7 64-bit. Thanks for any help you can provide.


goptions ftext=none dev=cgmof97l gsfname=grafout gsfmode=replace lfactor=9;

filename grafout 'c:\data\gi\soilh2o\soilh2o.cgm';

title1 h=.4 cm 'Total Water in Inches';

title2 h=.4 cm '2014 Soil Water to 2.5 Feet on Loamy Ecological Sites';

footnote1 h=2 ' ';

footnote2 j=l h=.299 cm 'Total water in soil profile to the two and one half foot depth on loamy ecological';

footnote3 j=l h=.149 cm ' ';

footnote4 j=l h=.299 cm 'sites at the Central Grasslands Research Extension Center in 2014.';

axis1 order=0 to 18 by 1 label=none value=(h=0.3 cm) major=(w=3) minor=none width=3;

axis2 value=(h=0.21 cm) width=3;

pattern c=black v=e;

proc gchart data=m2014sm annotate=legend;

   vbar day/type=mean sumvar=twlyrto

           axis=axis1 maxis=axis2

           midpoints='01apr00'd '15apr00'd '01may00'd '15may00'd

                     '01jun00'd '15jun00'd '01jul00'd '15jul00'd

                     '01aug00'd '15aug00'd '01sep00'd '15sep00'd

                     '01oct00'd '15oct00'd '01nov00'd '15nov00'd '01dec00'd

           space=0.65 annotate=annavetd;

   label day='Date';

   format twlyrto 2.0;



New Contributor
Posts: 2

Re: text from annotations in gchart importing as curves in cgm file

I received help from SAS support. I'll post the reply in case anyone else comes looking here for the answer:

I made some fairly minor changes to your original SAS code and have attached the modified code to this email.  When you have time, submit the attached code to SAS and let me know what happens.  The biggest change I made to your SAS code is to make sure that SAS is creating your graphics output where all of the text on the graph is created using the Helvetica hardware font.  When using a CGM device driver, you do this by specifying in your code the font name of HWCGM001. 

This is why the modified GOPTIONS statement now looks like this:

goptions reset=all device=cgmof97l gsfname=grafout gsfmode=replace lfactor=9

ftext=HWCGM001 ftitle=HWCGM001; 

I also noticed that since both of your Annotate data sets use the old SAS software font with the name of SWISS, I modified both Annotate data sets to change the old SWISS font to the HWCGM001 hardware font. 

With the attached code, you might have to "tweak" the code a bit more (perhaps adjusting some text heights and text positioning).  But the attached code should get you pretty close to what you are looking for. 

Regards, Martin


Martin Mincey

Thanks again Martin for your help.


Post a Question
Discussion Stats
  • 1 reply
  • 1 in conversation