SPSS Statistics

 View Only
  • 1.  SGT Restore Dynamic Title

    Posted Tue June 21, 2022 04:58 PM
    Hi all,

    I edited a chart and saved it as a .sgt template. I am able to set it into use but in my haste I hardcoded the title value along with the formatting. Now when I use the style all the charts irrespective of the syntax have the hard coded title Age Profile.
    If I change the style to Bright the correct title is shown. I tried looking at the bright.sgt but it doesn't have a title section that I can see. I wasn't able to find any reference guide for sgt so in case it helps anyone else it seems you can remove the text in the template and SPSS will use the value you specify in GRAPH. Seems obvious but it took me about 2 hrs to get there
    <addFrame count="1" type="title">
    		<location bottom="5%" left="0%" right="100%" top="1%"/>
    		<label><style color="#000000" color2="transparent" coordinate="0" font-family="Inter     " font-size="12pt" font-weight="bold" labelLocationHorizontal="negative" number="0" text-fit="false" visible="true"/>Age Profile</label>
    	</addFrame>​

    GGRAPH
    /GRAPHDATASET NAME="graphdataset" VARIABLES=Median_9_2CovidImpact COUNT()[name="COUNT"] Gender
    MISSING=LISTWISE REPORTMISSING=NO
    /GRAPHSPEC SOURCE=INLINE.
    BEGIN GPL
    SOURCE: s=userSource(id("graphdataset"))
    DATA: Median_9_2CovidImpact=col(source(s), name("Median_9_2CovidImpact"), unit.category())
    DATA: COUNT=col(source(s), name("COUNT"))
    DATA: Gender=col(source(s), name("Gender"), unit.category())
    COORD: rect(dim(1,2), cluster(3,0))
    GUIDE: axis(dim(3), label("What-Is-Your-Age-Range"))
    GUIDE: axis(dim(2), label("Percent"))
    GUIDE: legend(aesthetic(aesthetic.color.interior), label("Gender"))
    GUIDE: text.title(label("% Median_9_2CovidImpact by ",
    "Gender"))
    SCALE: linear(dim(2), include(0))
    ELEMENT: interval(position(summary.percent(Gender*COUNT*Median_9_2CovidImpact, base.all(acrossPanels()))),
    color.interior(Gender), shape.interior(shape.square))
    END GPL.

    ------------------------------
    Michael
    ------------------------------

    #SPSSStatistics


  • 2.  RE: SGT Restore Dynamic Title

    Posted Wed June 22, 2022 09:05 AM
    Good find Michael.  You probably could remove the entire "<addFrame...>...</addFrame>" section and get the same results.

    There is no official documentation on templates that I know of.  Editing XML documents is tricky and will likely cause issues.  If you are interested, take a look at the `vizml-template-3.5.xsd` file in the bin directory of your installation.  It has some comments explaining what the various parts of the template do.



    ------------------------------
    LOUIS Kittock
    ------------------------------