BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Jim_Cooper_hmsa
Obsidian | Level 7

I have been running report that produces a bar chart of the daily COVID-19 hospital admissions from March 15 2020 to current.  The bar chart stops displaying dates after July 14, 2021.  Is there a limit to the number of bars that can be displayed in a VBAR chart? 

Is there an option that will allow me to display the whole time line from March 15 2020 for the forseeable future or do I have to start sampling the data points?

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

It won't hurt to show your code.

 

If you are using an option to force a tick mark for every date that might limit things.

 

I would typically use a Needle plot to show a large number of values like this.

Example creating some dummy count data per day and displaying it.

data example;
  do date='01Jan2020'd to '31DEC2021'd;
     value= rand('integer',100);
     output;
  end;
  format date date9.;
run;

Proc sgplot;
   needle x= date y=value;
run;
   
 

View solution in original post

4 REPLIES 4
ballardw
Super User

It won't hurt to show your code.

 

If you are using an option to force a tick mark for every date that might limit things.

 

I would typically use a Needle plot to show a large number of values like this.

Example creating some dummy count data per day and displaying it.

data example;
  do date='01Jan2020'd to '31DEC2021'd;
     value= rand('integer',100);
     output;
  end;
  format date date9.;
run;

Proc sgplot;
   needle x= date y=value;
run;
   
 
Jim_Cooper_hmsa
Obsidian | Level 7

Here is the PROC SGPLOT statement that I am using.  The data is 403 observations for admissions from March 15, 2020 - August 15, 2021. The last data point in chart is July 21,2021

proc sgplot data=CovidAdmitSummary;
vbar CovidAdmitDT /response=Admissions nooutline barwidth=.7 missing;
xaxis fitpolicy=rotatethin interval=day ;
yaxis label='# Admissions' max=20 grid gridattrs=(color=lightblue pattern=1 thickness=.5);
format CovidAdmitDT date5.;
label CovidAdmitDT='Day of Admission';
run;

Jim_Cooper_hmsa_0-1629155816094.png

 

ballardw
Super User

It is extremely easy to test the needle plot.

Change your code to read

needle x=CovidAdmitDt y=Admissions;

instead of the VBAR you are currently using.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 508 views
  • 2 likes
  • 3 in conversation