Data visualization with SAS programming

How to include >200 midpoints for axis1 in GCHART

Accepted Solution Solved
Reply
Contributor
Posts: 30
Accepted Solution

How to include >200 midpoints for axis1 in GCHART

I can plot 125 midpoint nicely with this code below (SAS 9.2). When data piont go up to 262, I got the error massage. Do any one know a solution? proc gchart data=final anno=anno1; where arm=1; vbar count/ discrete sumvar=chg ascending noframe raxis=axis1 maxis=axis2 width=.2 space=0.4; run; quit; LOG: ERROR: There were 262 midpoints generated from the data. Specify levels=all to display the graph.

Accepted Solutions
Solution
‎03-04-2016 11:29 AM
Super User
Posts: 11,105

Re: How to include >200 midpoints for axis1 in GCHART

I did a test and it seems that 200 is the limit for Gchart with discrete VBAR.

 

The Needleplot doesn't have a limit though the display size may mean that there isn't much visible space between the vertical lines.

Here is a very brief example:

data needle;
   do xvar = 1 to 400;
      yvar = abs(200-xvar);
      output;
   end;
run;

ods graphics on;

proc sgplot data=needle;
   needle x=xvar y=yvar /
   ;
run;

ods graphics off;

Needleplot would require presummarizing data but I seldom used gchart to do the summaries anyway as I often needed to provide tables as well as charts.

 

View solution in original post


All Replies
Super User
Posts: 11,105

Re: How to include >200 midpoints for axis1 in GCHART

[ Edited ]

As the error says include LEVELS=ALL in the options to the VBAR.

For legibility you may need to increase the space available for your graphics output.

 

Alternatively you might investigate PROC SGPLOT with a NEEDLEPLOT though that might require presummarizing the data before plotting.

Contributor
Posts: 30

Re: How to include >200 midpoints for axis1 in GCHART

Helpful suggestion thank you! I will try. By the way, what is the number limit for gchart using discrete, or we can change setting somewhere?
Solution
‎03-04-2016 11:29 AM
Super User
Posts: 11,105

Re: How to include >200 midpoints for axis1 in GCHART

I did a test and it seems that 200 is the limit for Gchart with discrete VBAR.

 

The Needleplot doesn't have a limit though the display size may mean that there isn't much visible space between the vertical lines.

Here is a very brief example:

data needle;
   do xvar = 1 to 400;
      yvar = abs(200-xvar);
      output;
   end;
run;

ods graphics on;

proc sgplot data=needle;
   needle x=xvar y=yvar /
   ;
run;

ods graphics off;

Needleplot would require presummarizing data but I seldom used gchart to do the summaries anyway as I often needed to provide tables as well as charts.

 

Contributor
Posts: 30

Re: How to include >200 midpoints for axis1 in GCHART

Thanks a lot!
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 464 views
  • 1 like
  • 2 in conversation