<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic PROC SGPLOT, customizing text using my own style element - impossible ? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-customizing-text-using-my-own-style-element/m-p/31036#M957</link>
    <description>Hi to all,&lt;BR /&gt;
&lt;BR /&gt;
I'm having a problem...&lt;BR /&gt;
&lt;BR /&gt;
Let's work with this table :&lt;BR /&gt;
DATA test;&lt;BR /&gt;
   DO x=1 TO 20;&lt;BR /&gt;
      y+25X+250;&lt;BR /&gt;
   OUTPUT;&lt;BR /&gt;
  END;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
I'd like to build this graph using PROC SGPLOT :&lt;BR /&gt;
&lt;BR /&gt;
PROC SGPLOT DATA=test;&lt;BR /&gt;
INSET "text of my INSET part 1" "part 2" / position=topleft  ;&lt;BR /&gt;
SERIES x=x y=y;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
but I would like to customize the text of my INSET : I would like to have a bold text, 13pt, using this color: CX800080&lt;BR /&gt;
&lt;BR /&gt;
The TEXTATTRS option should be used here but you can only associate this option to a style element. So, I'm creating a new style using PROC TEMPLATE this way:&lt;BR /&gt;
&lt;BR /&gt;
PROC TEMPLATE;&lt;BR /&gt;
DEFINE STYLE modif4;&lt;BR /&gt;
PARENT = styles.listing;&lt;BR /&gt;
   CLASS insettext /&lt;BR /&gt;
      FONT = ("&lt;SANS-SERIF&gt;, &lt;MTSANS-SERIF&gt;",13pt,bold)&lt;BR /&gt;
      COLOR = CX800080;&lt;BR /&gt;
END;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
(using STYLE instead of CLASS) won't solve my problem) &lt;BR /&gt;
If I'm now running this program:&lt;BR /&gt;
&lt;BR /&gt;
ODS LISTING STYLE=modif4;&lt;BR /&gt;
PROC SGPLOT DATA=test;&lt;BR /&gt;
   INSET "text of my INSET part 1" "part 2" / POSITION=topleft TEXTATTRS=INSETTEXT ;&lt;BR /&gt;
   SERIES X=x Y=y;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
I'm having this message in my log:&lt;BR /&gt;
WARNING: The style reference 'insettext' is invalid. The reference will be ignored.&lt;BR /&gt;
WARNING: The style reference 'insettext' is invalid. The reference will be ignored.&lt;BR /&gt;
&lt;BR /&gt;
In fact, I can only associate TEXTATTRS to an existing style element as GraphTitleText, GraphFootnoteText,  GraphDataText, GraphLabelText,  GraphValueText (this latter one is the default style used by TEXTATTRS).&lt;BR /&gt;
&lt;BR /&gt;
Well, I can modify one of the existing text style elements but those style elements are used by one text element of the graph. I would like to be sure that only my inset text will be formatted the way I want.&lt;BR /&gt;
&lt;BR /&gt;
modifying GraphValueText will modify the values on the axis&lt;BR /&gt;
modifying GraphDataText will modify the point label if I'm using the DATALABEL option,&lt;BR /&gt;
etc. &lt;BR /&gt;
&lt;BR /&gt;
Is there a problem here or is there a solution ?&lt;BR /&gt;
&lt;BR /&gt;
best regards&lt;BR /&gt;
&lt;BR /&gt;
Sébastien&lt;/MTSANS-SERIF&gt;&lt;/SANS-SERIF&gt;</description>
    <pubDate>Wed, 16 Dec 2009 14:01:51 GMT</pubDate>
    <dc:creator>SR_FR</dc:creator>
    <dc:date>2009-12-16T14:01:51Z</dc:date>
    <item>
      <title>PROC SGPLOT, customizing text using my own style element - impossible ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-customizing-text-using-my-own-style-element/m-p/31036#M957</link>
      <description>Hi to all,&lt;BR /&gt;
&lt;BR /&gt;
I'm having a problem...&lt;BR /&gt;
&lt;BR /&gt;
Let's work with this table :&lt;BR /&gt;
DATA test;&lt;BR /&gt;
   DO x=1 TO 20;&lt;BR /&gt;
      y+25X+250;&lt;BR /&gt;
   OUTPUT;&lt;BR /&gt;
  END;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
I'd like to build this graph using PROC SGPLOT :&lt;BR /&gt;
&lt;BR /&gt;
PROC SGPLOT DATA=test;&lt;BR /&gt;
INSET "text of my INSET part 1" "part 2" / position=topleft  ;&lt;BR /&gt;
SERIES x=x y=y;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
but I would like to customize the text of my INSET : I would like to have a bold text, 13pt, using this color: CX800080&lt;BR /&gt;
&lt;BR /&gt;
The TEXTATTRS option should be used here but you can only associate this option to a style element. So, I'm creating a new style using PROC TEMPLATE this way:&lt;BR /&gt;
&lt;BR /&gt;
PROC TEMPLATE;&lt;BR /&gt;
DEFINE STYLE modif4;&lt;BR /&gt;
PARENT = styles.listing;&lt;BR /&gt;
   CLASS insettext /&lt;BR /&gt;
      FONT = ("&lt;SANS-SERIF&gt;, &lt;MTSANS-SERIF&gt;",13pt,bold)&lt;BR /&gt;
      COLOR = CX800080;&lt;BR /&gt;
END;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
(using STYLE instead of CLASS) won't solve my problem) &lt;BR /&gt;
If I'm now running this program:&lt;BR /&gt;
&lt;BR /&gt;
ODS LISTING STYLE=modif4;&lt;BR /&gt;
PROC SGPLOT DATA=test;&lt;BR /&gt;
   INSET "text of my INSET part 1" "part 2" / POSITION=topleft TEXTATTRS=INSETTEXT ;&lt;BR /&gt;
   SERIES X=x Y=y;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
I'm having this message in my log:&lt;BR /&gt;
WARNING: The style reference 'insettext' is invalid. The reference will be ignored.&lt;BR /&gt;
WARNING: The style reference 'insettext' is invalid. The reference will be ignored.&lt;BR /&gt;
&lt;BR /&gt;
In fact, I can only associate TEXTATTRS to an existing style element as GraphTitleText, GraphFootnoteText,  GraphDataText, GraphLabelText,  GraphValueText (this latter one is the default style used by TEXTATTRS).&lt;BR /&gt;
&lt;BR /&gt;
Well, I can modify one of the existing text style elements but those style elements are used by one text element of the graph. I would like to be sure that only my inset text will be formatted the way I want.&lt;BR /&gt;
&lt;BR /&gt;
modifying GraphValueText will modify the values on the axis&lt;BR /&gt;
modifying GraphDataText will modify the point label if I'm using the DATALABEL option,&lt;BR /&gt;
etc. &lt;BR /&gt;
&lt;BR /&gt;
Is there a problem here or is there a solution ?&lt;BR /&gt;
&lt;BR /&gt;
best regards&lt;BR /&gt;
&lt;BR /&gt;
Sébastien&lt;/MTSANS-SERIF&gt;&lt;/SANS-SERIF&gt;</description>
      <pubDate>Wed, 16 Dec 2009 14:01:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-customizing-text-using-my-own-style-element/m-p/31036#M957</guid>
      <dc:creator>SR_FR</dc:creator>
      <dc:date>2009-12-16T14:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT, customizing text using my own style element - impossible ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-customizing-text-using-my-own-style-element/m-p/31037#M958</link>
      <description>Hey Sébastien,&lt;BR /&gt;
&lt;BR /&gt;
The missing font control int he procedures is being addressed.  In the meantime, you can work around this issue by having SGPLOT generate GTL for you and modifying the GTL.  Taking your example, add the TMPLOUT option to SGPLOT:&lt;BR /&gt;
&lt;BR /&gt;
PROC SGPLOT DATA=test tmplout="temp.sas";&lt;BR /&gt;
INSET "text of my INSET part 1" "part 2" / position=topleft  ; &lt;BR /&gt;
SERIES x=x y=y; RUN;&lt;BR /&gt;
&lt;BR /&gt;
temp.sas will look like this:&lt;BR /&gt;
proc template;&lt;BR /&gt;
define statgraph sgplot;&lt;BR /&gt;
begingraph;&lt;BR /&gt;
layout overlay;&lt;BR /&gt;
   Layout Gridded / Border=false halign=left valign=top;&lt;BR /&gt;
   Layout Gridded;&lt;BR /&gt;
   Entry halign=left "text of my INSET part 1" / textattrs=GraphValueText;&lt;BR /&gt;
   Entry halign=left "part 2" / textattrs=GraphValueText;&lt;BR /&gt;
endlayout;&lt;BR /&gt;
endlayout;&lt;BR /&gt;
SeriesPlot X=x Y=y / primary=true LegendLabel="y" NAME="SERIES";&lt;BR /&gt;
endlayout;&lt;BR /&gt;
endgraph;&lt;BR /&gt;
end;&lt;BR /&gt;
&lt;BR /&gt;
Modify the textattrs as you said in your post:&lt;BR /&gt;
&lt;BR /&gt;
proc template;&lt;BR /&gt;
define statgraph sgplot;&lt;BR /&gt;
begingraph;&lt;BR /&gt;
layout overlay;&lt;BR /&gt;
   Layout Gridded / Border=false halign=left valign=top;&lt;BR /&gt;
   Layout Gridded;&lt;BR /&gt;
   Entry halign=left "text of my INSET part 1" / textattrs=GraphValueText(weight=bold size=13pt color=CX800080);&lt;BR /&gt;
   Entry halign=left "part 2" / textattrs=GraphValueText(weight=bold size=13pt color=CX800080);&lt;BR /&gt;
endlayout;&lt;BR /&gt;
endlayout;&lt;BR /&gt;
SeriesPlot X=x Y=y / primary=true LegendLabel="y" NAME="SERIES";&lt;BR /&gt;
endlayout;&lt;BR /&gt;
endgraph;&lt;BR /&gt;
end;&lt;BR /&gt;
&lt;BR /&gt;
Add this call to execute the template:&lt;BR /&gt;
&lt;BR /&gt;
proc sgrender data=test template=sgplot; run;</description>
      <pubDate>Wed, 16 Dec 2009 17:16:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-customizing-text-using-my-own-style-element/m-p/31037#M958</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2009-12-16T17:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT, customizing text using my own style element - impossible ?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-customizing-text-using-my-own-style-element/m-p/31038#M959</link>
      <description>Hi Dan&lt;BR /&gt;
&lt;BR /&gt;
Thanks for your answer (we already had a conversation together.. the French guy with his problem with BAND... as you can see I'm still working on the SG procedures!).&lt;BR /&gt;
&lt;BR /&gt;
Well, I'm having the expected result with your method and things are clearer now: in fact, you can't use your own style element (with their own name) to customize your result.  &lt;BR /&gt;
&lt;BR /&gt;
thanks!&lt;BR /&gt;
&lt;BR /&gt;
best regards&lt;BR /&gt;
&lt;BR /&gt;
Sébastien</description>
      <pubDate>Thu, 17 Dec 2009 09:44:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-customizing-text-using-my-own-style-element/m-p/31038#M959</guid>
      <dc:creator>SR_FR</dc:creator>
      <dc:date>2009-12-17T09:44:20Z</dc:date>
    </item>
  </channel>
</rss>

