<?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 Re: TickValueFormat is not working in GTL with no Lattice in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/TickValueFormat-is-not-working-in-GTL-with-no-Lattice/m-p/949475#M25097</link>
    <description>&lt;P&gt;I don't think the base of bar charts can be considered "linear" as they are categorical. So I'm not surprised that LINEAROPTS applied to that axis misbehave. Kind of says so right in the syntax:&lt;/P&gt;
&lt;PRE&gt;barchart category=&amp;lt;variable name&amp;gt;&lt;/PRE&gt;
&lt;P&gt;The variable is categorical.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/470812"&gt;@Eric_Lee&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="barchart_with_lattice.png" style="width: 656px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/101873i6A88128CCAFA31B2/image-size/large?v=v2&amp;amp;px=999" role="button" title="barchart_with_lattice.png" alt="barchart_with_lattice.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Please ignore the gray square in legend, this can be fixed by '&lt;SPAN&gt;legendItem&lt;/SPAN&gt;'.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;This is the picture I wanted. The percent of the car produced have been displayed by categories ( the cars' Type and DriveTrain).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, when I generated the figure by statgraph 'barchart_with_no_lattice', the tick values of y axis were not displayed as expected. The code is as follows:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;About the format of 'cateparam.', please refer to the last part.&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;proc template;
  define statgraph barchart_with_no_lattice;
    begingraph /border=false;

      discreteattrmap name='colors' / ignorecase=true;
        value "Asia"     / lineattrs=(color=&amp;amp;color1.)  fillattrs=(color=&amp;amp;color1.);
        value "Europe"   / lineattrs=(color=&amp;amp;color2.)  fillattrs=(color=&amp;amp;color2.);
        value "USA"      / lineattrs=(color=&amp;amp;color3.)  fillattrs=(color=&amp;amp;color3.);
      enddiscreteattrmap;
      discreteattrvar attrvar=barcolors var=origin attrmap='colors';

      layout overlay /
        yaxisopts = (display=(ticks tickvalues) 
          linearopts=(tickvaluesequence=(start=&amp;amp;xmin. end=&amp;amp;xmax. increment=1) tickvalueformat=cateparam.))
        xaxisopts = (display=(ticks tickvalues)
          linearopts=(viewmax=100 viewmin=0 tickvaluesequence=(start=0 end=100 increment=10)));

        barchart category=paramn response=percent / name='origin' group=barcolors orient=horizontal grouporder=data
          groupdisplay=stack display=(fill);
        discretelegend 'origin';
      endlayout;
    endgraph;
  end;
run;

ods graphics on / reset outputfmt=png imagename='barchart_with_no_lattice';
proc sgrender data=type_new template=barchart_with_no_lattice;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The figure generated by 'barchart_with_no_lattice':&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="barchart_with_no_lattice.png" style="width: 657px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/101872iADD58E757A957182/image-size/large?v=v2&amp;amp;px=999" role="button" title="barchart_with_no_lattice.png" alt="barchart_with_no_lattice.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Please ignore the gray square in legend, this can be fixed by '&lt;SPAN&gt;legendItem&lt;/SPAN&gt;'.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And, I used the 'lattice' to display the text for a temporary solution, left and right. In the left figure, I wantted to display the text that should be showed in tick values. Suddendly, I found the TickValueFormat was working as expected, so the width of left figure was set to 0, finally the first figure above was generated. the code I used as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;proc template;
  define statgraph barchart_with_lattice;
    begingraph /border=false;

      discreteattrmap name='colors' / ignorecase=true;
        value "Asia"     / lineattrs=(color=&amp;amp;color1.)  fillattrs=(color=&amp;amp;color1.);
        value "Europe"   / lineattrs=(color=&amp;amp;color2.)  fillattrs=(color=&amp;amp;color2.);
        value "USA"      / lineattrs=(color=&amp;amp;color3.)  fillattrs=(color=&amp;amp;color3.);
      enddiscreteattrmap;
      discreteattrvar attrvar=barcolors var=origin attrmap='colors';

      layout lattice / columns=2  columnweights=(0 1.0) rowdatarange=union;

        layout overlay / walldisplay=none yaxisopts=(display=none) xaxisopts=(display=none);
          scatterplot y=paramn x=param /markercharacterposition=right;
        endlayout;

        layout overlay /
          yaxisopts=(display=(ticks tickvalues) 
            linearopts=(tickvaluesequence=(start=&amp;amp;xmin. end=&amp;amp;xmax. increment=1) tickvalueformat=cateparam.))
          xaxisopts=(display=(ticks tickvalues)
            linearopts=(viewmax=100 viewmin=0 tickvaluesequence=(start=0 end=100 increment=10)));

          barchart category=paramn response=percent / name='origin' group=barcolors orient=horizontal grouporder=data
            groupdisplay=stack display=(fill);
          discretelegend 'origin';
        endlayout;

      endlayout;
    endgraph;
  end;
run;

ods graphics on / reset outputfmt=png imagename='barchart_with_lattice';
proc sgrender data=type_new template=barchart_with_lattice;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Did I miss something in 'barchart_with_no_lattice'? Why did not the TickValueFormat work?&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data used by 'PROC SGRENDER' was generated by this code, dataset's name is 'type_new':&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;data cars;
  set sashelp.cars;
  format _all_;informat _all_;
run;

proc sql noprint;
  create table type01_01 as
    select distinct type,origin,count(distinct model) as count from cars group by type,origin;
  create table type01_02 as
    select distinct type,count(distinct model) as bign from cars group by type;

  create table type01 as
    select lds.*,rds.bign from type01_01 lds left join type01_02 rds on lds.type=rds.type;
quit;

proc sql noprint;
  create table type02_01 as
    select distinct drivetrain,origin,count(distinct model) as count from cars group by drivetrain,origin;
  create table type02_02 as
    select distinct drivetrain,count(distinct model) as bign from cars group by drivetrain;

  create table type02 as
    select lds.*,rds.bign from type02_01 lds left join type02_02 rds on lds.drivetrain=rds.drivetrain;
quit;

data type1;
  length cate param $200 percent 8;
  set type01(in=a) type02(in=b);
  if a then cate='1st Category';
  else cate='2nd Category';
  param=coalescec(type,drivetrain);
  percent=count/bign*100;
run;
proc sort;by cate param;run;

data type9;
  set type1;
  by cate param;
  output;
  if first.cate then do;
    param=strip(cate);call missing(percent,origin);
    output;
  end;
run;
proc sort;by descending cate descending param;run;

data type_new;
  length paramn 8;
  retain paramn;
  set type9;
  by descending cate descending param;
  if _n_=1 then paramn=0;
  if first.param then paramn=paramn+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The format and macro variables was generated by this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;data format;
  length fmtname $200 start 8 label type $200;
  set type_new;
  fmtname='cateparam';
  start=paramn;
  label=strip(param);
  type='n';
  keep fmtname start label type;
run;
proc sort data=format nodupkey;by start label;run;

proc format library=work cntlin=format;run;

proc sql noprint;
  select min(start) into:xmin trimmed from format;
  select max(start) into:xmax trimmed from format;
quit;
%put &amp;amp;xmin. &amp;amp;xmax.;

%let color1=vligb;
%let color2=liyg;
%let color3=lioy;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The full code also was uploaded by 'txt' in the attachment.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Oct 2024 13:58:12 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2024-10-30T13:58:12Z</dc:date>
    <item>
      <title>TickValueFormat is not working in GTL with no Lattice</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/TickValueFormat-is-not-working-in-GTL-with-no-Lattice/m-p/949442#M25094</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="barchart_with_lattice.png" style="width: 656px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/101873i6A88128CCAFA31B2/image-size/large?v=v2&amp;amp;px=999" role="button" title="barchart_with_lattice.png" alt="barchart_with_lattice.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Please ignore the gray square in legend, this can be fixed by '&lt;SPAN&gt;legendItem&lt;/SPAN&gt;'.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;This is the picture I wanted. The percent of the car produced have been displayed by categories ( the cars' Type and DriveTrain).&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, when I generated the figure by statgraph 'barchart_with_no_lattice', the tick values of y axis were not displayed as expected. The code is as follows:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;About the format of 'cateparam.', please refer to the last part.&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc template;
  define statgraph barchart_with_no_lattice;
    begingraph /border=false;

      discreteattrmap name='colors' / ignorecase=true;
        value "Asia"     / lineattrs=(color=&amp;amp;color1.)  fillattrs=(color=&amp;amp;color1.);
        value "Europe"   / lineattrs=(color=&amp;amp;color2.)  fillattrs=(color=&amp;amp;color2.);
        value "USA"      / lineattrs=(color=&amp;amp;color3.)  fillattrs=(color=&amp;amp;color3.);
      enddiscreteattrmap;
      discreteattrvar attrvar=barcolors var=origin attrmap='colors';

      layout overlay /
        yaxisopts = (display=(ticks tickvalues) 
          linearopts=(tickvaluesequence=(start=&amp;amp;xmin. end=&amp;amp;xmax. increment=1) tickvalueformat=cateparam.))
        xaxisopts = (display=(ticks tickvalues)
          linearopts=(viewmax=100 viewmin=0 tickvaluesequence=(start=0 end=100 increment=10)));

        barchart category=paramn response=percent / name='origin' group=barcolors orient=horizontal grouporder=data
          groupdisplay=stack display=(fill);
        discretelegend 'origin';
      endlayout;
    endgraph;
  end;
run;

ods graphics on / reset outputfmt=png imagename='barchart_with_no_lattice';
proc sgrender data=type_new template=barchart_with_no_lattice;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The figure generated by 'barchart_with_no_lattice':&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="barchart_with_no_lattice.png" style="width: 657px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/101872iADD58E757A957182/image-size/large?v=v2&amp;amp;px=999" role="button" title="barchart_with_no_lattice.png" alt="barchart_with_no_lattice.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Please ignore the gray square in legend, this can be fixed by '&lt;SPAN&gt;legendItem&lt;/SPAN&gt;'.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And, I used the 'lattice' to display the text for a temporary solution, left and right. In the left figure, I wantted to display the text that should be showed in tick values. Suddendly, I found the TickValueFormat was working as expected, so the width of left figure was set to 0, finally the first figure above was generated. the code I used as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc template;
  define statgraph barchart_with_lattice;
    begingraph /border=false;

      discreteattrmap name='colors' / ignorecase=true;
        value "Asia"     / lineattrs=(color=&amp;amp;color1.)  fillattrs=(color=&amp;amp;color1.);
        value "Europe"   / lineattrs=(color=&amp;amp;color2.)  fillattrs=(color=&amp;amp;color2.);
        value "USA"      / lineattrs=(color=&amp;amp;color3.)  fillattrs=(color=&amp;amp;color3.);
      enddiscreteattrmap;
      discreteattrvar attrvar=barcolors var=origin attrmap='colors';

      layout lattice / columns=2  columnweights=(0 1.0) rowdatarange=union;

        layout overlay / walldisplay=none yaxisopts=(display=none) xaxisopts=(display=none);
          scatterplot y=paramn x=param /markercharacterposition=right;
        endlayout;

        layout overlay /
          yaxisopts=(display=(ticks tickvalues) 
            linearopts=(tickvaluesequence=(start=&amp;amp;xmin. end=&amp;amp;xmax. increment=1) tickvalueformat=cateparam.))
          xaxisopts=(display=(ticks tickvalues)
            linearopts=(viewmax=100 viewmin=0 tickvaluesequence=(start=0 end=100 increment=10)));

          barchart category=paramn response=percent / name='origin' group=barcolors orient=horizontal grouporder=data
            groupdisplay=stack display=(fill);
          discretelegend 'origin';
        endlayout;

      endlayout;
    endgraph;
  end;
run;

ods graphics on / reset outputfmt=png imagename='barchart_with_lattice';
proc sgrender data=type_new template=barchart_with_lattice;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Did I miss something in 'barchart_with_no_lattice'? Why did not the TickValueFormat work?&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data used by 'PROC SGRENDER' was generated by this code, dataset's name is 'type_new':&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data cars;
  set sashelp.cars;
  format _all_;informat _all_;
run;

proc sql noprint;
  create table type01_01 as
    select distinct type,origin,count(distinct model) as count from cars group by type,origin;
  create table type01_02 as
    select distinct type,count(distinct model) as bign from cars group by type;

  create table type01 as
    select lds.*,rds.bign from type01_01 lds left join type01_02 rds on lds.type=rds.type;
quit;

proc sql noprint;
  create table type02_01 as
    select distinct drivetrain,origin,count(distinct model) as count from cars group by drivetrain,origin;
  create table type02_02 as
    select distinct drivetrain,count(distinct model) as bign from cars group by drivetrain;

  create table type02 as
    select lds.*,rds.bign from type02_01 lds left join type02_02 rds on lds.drivetrain=rds.drivetrain;
quit;

data type1;
  length cate param $200 percent 8;
  set type01(in=a) type02(in=b);
  if a then cate='1st Category';
  else cate='2nd Category';
  param=coalescec(type,drivetrain);
  percent=count/bign*100;
run;
proc sort;by cate param;run;

data type9;
  set type1;
  by cate param;
  output;
  if first.cate then do;
    param=strip(cate);call missing(percent,origin);
    output;
  end;
run;
proc sort;by descending cate descending param;run;

data type_new;
  length paramn 8;
  retain paramn;
  set type9;
  by descending cate descending param;
  if _n_=1 then paramn=0;
  if first.param then paramn=paramn+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The format and macro variables was generated by this code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data format;
  length fmtname $200 start 8 label type $200;
  set type_new;
  fmtname='cateparam';
  start=paramn;
  label=strip(param);
  type='n';
  keep fmtname start label type;
run;
proc sort data=format nodupkey;by start label;run;

proc format library=work cntlin=format;run;

proc sql noprint;
  select min(start) into:xmin trimmed from format;
  select max(start) into:xmax trimmed from format;
quit;
%put &amp;amp;xmin. &amp;amp;xmax.;

%let color1=vligb;
%let color2=liyg;
%let color3=lioy;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The full code also was uploaded by 'txt' in the attachment.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 02:03:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/TickValueFormat-is-not-working-in-GTL-with-no-Lattice/m-p/949442#M25094</guid>
      <dc:creator>Eric_Lee</dc:creator>
      <dc:date>2024-10-30T02:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: TickValueFormat is not working in GTL with no Lattice</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/TickValueFormat-is-not-working-in-GTL-with-no-Lattice/m-p/949475#M25097</link>
      <description>&lt;P&gt;I don't think the base of bar charts can be considered "linear" as they are categorical. So I'm not surprised that LINEAROPTS applied to that axis misbehave. Kind of says so right in the syntax:&lt;/P&gt;
&lt;PRE&gt;barchart category=&amp;lt;variable name&amp;gt;&lt;/PRE&gt;
&lt;P&gt;The variable is categorical.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/470812"&gt;@Eric_Lee&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="barchart_with_lattice.png" style="width: 656px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/101873i6A88128CCAFA31B2/image-size/large?v=v2&amp;amp;px=999" role="button" title="barchart_with_lattice.png" alt="barchart_with_lattice.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Please ignore the gray square in legend, this can be fixed by '&lt;SPAN&gt;legendItem&lt;/SPAN&gt;'.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;This is the picture I wanted. The percent of the car produced have been displayed by categories ( the cars' Type and DriveTrain).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But, when I generated the figure by statgraph 'barchart_with_no_lattice', the tick values of y axis were not displayed as expected. The code is as follows:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;About the format of 'cateparam.', please refer to the last part.&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;proc template;
  define statgraph barchart_with_no_lattice;
    begingraph /border=false;

      discreteattrmap name='colors' / ignorecase=true;
        value "Asia"     / lineattrs=(color=&amp;amp;color1.)  fillattrs=(color=&amp;amp;color1.);
        value "Europe"   / lineattrs=(color=&amp;amp;color2.)  fillattrs=(color=&amp;amp;color2.);
        value "USA"      / lineattrs=(color=&amp;amp;color3.)  fillattrs=(color=&amp;amp;color3.);
      enddiscreteattrmap;
      discreteattrvar attrvar=barcolors var=origin attrmap='colors';

      layout overlay /
        yaxisopts = (display=(ticks tickvalues) 
          linearopts=(tickvaluesequence=(start=&amp;amp;xmin. end=&amp;amp;xmax. increment=1) tickvalueformat=cateparam.))
        xaxisopts = (display=(ticks tickvalues)
          linearopts=(viewmax=100 viewmin=0 tickvaluesequence=(start=0 end=100 increment=10)));

        barchart category=paramn response=percent / name='origin' group=barcolors orient=horizontal grouporder=data
          groupdisplay=stack display=(fill);
        discretelegend 'origin';
      endlayout;
    endgraph;
  end;
run;

ods graphics on / reset outputfmt=png imagename='barchart_with_no_lattice';
proc sgrender data=type_new template=barchart_with_no_lattice;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The figure generated by 'barchart_with_no_lattice':&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="barchart_with_no_lattice.png" style="width: 657px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/101872iADD58E757A957182/image-size/large?v=v2&amp;amp;px=999" role="button" title="barchart_with_no_lattice.png" alt="barchart_with_no_lattice.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Please ignore the gray square in legend, this can be fixed by '&lt;SPAN&gt;legendItem&lt;/SPAN&gt;'.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And, I used the 'lattice' to display the text for a temporary solution, left and right. In the left figure, I wantted to display the text that should be showed in tick values. Suddendly, I found the TickValueFormat was working as expected, so the width of left figure was set to 0, finally the first figure above was generated. the code I used as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;proc template;
  define statgraph barchart_with_lattice;
    begingraph /border=false;

      discreteattrmap name='colors' / ignorecase=true;
        value "Asia"     / lineattrs=(color=&amp;amp;color1.)  fillattrs=(color=&amp;amp;color1.);
        value "Europe"   / lineattrs=(color=&amp;amp;color2.)  fillattrs=(color=&amp;amp;color2.);
        value "USA"      / lineattrs=(color=&amp;amp;color3.)  fillattrs=(color=&amp;amp;color3.);
      enddiscreteattrmap;
      discreteattrvar attrvar=barcolors var=origin attrmap='colors';

      layout lattice / columns=2  columnweights=(0 1.0) rowdatarange=union;

        layout overlay / walldisplay=none yaxisopts=(display=none) xaxisopts=(display=none);
          scatterplot y=paramn x=param /markercharacterposition=right;
        endlayout;

        layout overlay /
          yaxisopts=(display=(ticks tickvalues) 
            linearopts=(tickvaluesequence=(start=&amp;amp;xmin. end=&amp;amp;xmax. increment=1) tickvalueformat=cateparam.))
          xaxisopts=(display=(ticks tickvalues)
            linearopts=(viewmax=100 viewmin=0 tickvaluesequence=(start=0 end=100 increment=10)));

          barchart category=paramn response=percent / name='origin' group=barcolors orient=horizontal grouporder=data
            groupdisplay=stack display=(fill);
          discretelegend 'origin';
        endlayout;

      endlayout;
    endgraph;
  end;
run;

ods graphics on / reset outputfmt=png imagename='barchart_with_lattice';
proc sgrender data=type_new template=barchart_with_lattice;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Did I miss something in 'barchart_with_no_lattice'? Why did not the TickValueFormat work?&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for any information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The data used by 'PROC SGRENDER' was generated by this code, dataset's name is 'type_new':&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;data cars;
  set sashelp.cars;
  format _all_;informat _all_;
run;

proc sql noprint;
  create table type01_01 as
    select distinct type,origin,count(distinct model) as count from cars group by type,origin;
  create table type01_02 as
    select distinct type,count(distinct model) as bign from cars group by type;

  create table type01 as
    select lds.*,rds.bign from type01_01 lds left join type01_02 rds on lds.type=rds.type;
quit;

proc sql noprint;
  create table type02_01 as
    select distinct drivetrain,origin,count(distinct model) as count from cars group by drivetrain,origin;
  create table type02_02 as
    select distinct drivetrain,count(distinct model) as bign from cars group by drivetrain;

  create table type02 as
    select lds.*,rds.bign from type02_01 lds left join type02_02 rds on lds.drivetrain=rds.drivetrain;
quit;

data type1;
  length cate param $200 percent 8;
  set type01(in=a) type02(in=b);
  if a then cate='1st Category';
  else cate='2nd Category';
  param=coalescec(type,drivetrain);
  percent=count/bign*100;
run;
proc sort;by cate param;run;

data type9;
  set type1;
  by cate param;
  output;
  if first.cate then do;
    param=strip(cate);call missing(percent,origin);
    output;
  end;
run;
proc sort;by descending cate descending param;run;

data type_new;
  length paramn 8;
  retain paramn;
  set type9;
  by descending cate descending param;
  if _n_=1 then paramn=0;
  if first.param then paramn=paramn+1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The format and macro variables was generated by this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;data format;
  length fmtname $200 start 8 label type $200;
  set type_new;
  fmtname='cateparam';
  start=paramn;
  label=strip(param);
  type='n';
  keep fmtname start label type;
run;
proc sort data=format nodupkey;by start label;run;

proc format library=work cntlin=format;run;

proc sql noprint;
  select min(start) into:xmin trimmed from format;
  select max(start) into:xmax trimmed from format;
quit;
%put &amp;amp;xmin. &amp;amp;xmax.;

%let color1=vligb;
%let color2=liyg;
%let color3=lioy;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The full code also was uploaded by 'txt' in the attachment.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 13:58:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/TickValueFormat-is-not-working-in-GTL-with-no-Lattice/m-p/949475#M25097</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-10-30T13:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: TickValueFormat is not working in GTL with no Lattice</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/TickValueFormat-is-not-working-in-GTL-with-no-Lattice/m-p/949504#M25099</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;is correct that the bar chart category axis is discrete by default, causing the TickValueFormat in the LINEAROPTS to be ignored. However, bar chart DO support linear category axes. So, if you set the Y axis explicitly to be TYPE=LINEAR, your format should be honored. Let us know if that works for you.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 17:34:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/TickValueFormat-is-not-working-in-GTL-with-no-Lattice/m-p/949504#M25099</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2024-10-30T17:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: TickValueFormat is not working in GTL with no Lattice</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/TickValueFormat-is-not-working-in-GTL-with-no-Lattice/m-p/949548#M25101</link>
      <description>Thanks for your reply. This make it sense about 'category'.</description>
      <pubDate>Wed, 30 Oct 2024 23:14:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/TickValueFormat-is-not-working-in-GTL-with-no-Lattice/m-p/949548#M25101</guid>
      <dc:creator>Eric_Lee</dc:creator>
      <dc:date>2024-10-30T23:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: TickValueFormat is not working in GTL with no Lattice</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/TickValueFormat-is-not-working-in-GTL-with-no-Lattice/m-p/949549#M25102</link>
      <description>It works as expected. Thank you very much. Also, I got the idea about the usage of 'category'. Lots of help.</description>
      <pubDate>Wed, 30 Oct 2024 23:17:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/TickValueFormat-is-not-working-in-GTL-with-no-Lattice/m-p/949549#M25102</guid>
      <dc:creator>Eric_Lee</dc:creator>
      <dc:date>2024-10-30T23:17:39Z</dc:date>
    </item>
  </channel>
</rss>

