BookmarkSubscribeRSS Feed
TimH
Quartz | Level 8

I am trying to do a 'timeline' of events using SGPLOT and a horizontal, stacked,  high-low graph.  The Y-axis is a variable which specifies which 'track' an item is on (right now, up to 20);  the X-axis is time. 

Each item has that will be on the graph has a data label that should be in the box that's drawn on the track.   I need a technique to let me scale the horizontal dimension so that a minimum of eight characters can appear in each box (cell? what is the proper term for one section of the stack) and that that box is wide enough to show those characters - therefore the smallest box's duration has to scale to wide enough to be 8-10 characters wide..  Here's the code I'm using right now, using HTML and PNG.  I've been trying to adjust the width but I don't think pixels is the way to go.

 

1. Should I try using HTML5 and SVG ?
2. This will be projected (via Powerpoint eventually) so it will "zoom" due to projection
3. Another option is to go to a PCL plotter but I'm not sure how it'll get there yet.

 


====================================================================================================
ODS GRAPHICS on /                                               
 OUTPUTFMT = PNG                                                
 WIDTH  = 7680px                                                
 HEIGHT = 1080px                                                
 IMAGEMAP                                                       
 IMAGENAME="Job-Timeline";                                      
PROC SGPLOT DATA=JOB_TIME                                       
            DESCRIPTION="Job Timeline"                          
            NOAUTOLEGEND;                                       
   TITLE1 "Jobs Executing";                                     
   HIGHLOW Y=STACK_LEVEL                                        
             LOW=JINITIME                                       
             HIGH=JTRMTIME /                                    
                          TYPE=BAR                              
                          FILL                                  
                          OUTLINE                               
                          FILLATTRS=(COLOR=LIGHTGREEN)          
                          LINEATTRS=(PATTERN=SOLID COLOR=BLACK);
   XAXIS  INTERVAL=MINUTE                                        
          MINOR                                                 
          FITPOLICY=ROTATETHIN   
          TICKVALUEFORMAT=TIME8.;
   YAXIS  MINOR                  
          MIN=0                  
          MAX=20;                
   LABEL STACK_LEVEL = '';      

==========================================================================================

3 REPLIES 3
ballardw
Super User

Without data it is hard to visualize the problem or test code to address it. Also, which version of SAS are you using as there are notable differences available such as if you are using a late enough edition there is an ODS POWERPOINT destination that I would suggest using so there are minimal issues with the presentation.

 

Could you provide a datastep of data similar to what you are using that will recreate the issue.

 

 

TimH
Quartz | Level 8

I'll try to get a DATASTEP later today.

TimH
Quartz | Level 8

Well when looking at the data, the shortest duration is  .01 seconds (one-one hundredth) and the longest is 2748.97 seconds. This is during an overall time period of 50400 seconds (an overnight period, from 5 PM to 7 AM).  I've eliminated the idea of this chart (at least as a wall chart) with the following logic

(perhaps) eliminate anything with duration under 1 second.
One second has to equal approximately 10 characters (8-character name plus some space on each side).

So, one second equals 10*n  where n = the width of a character.
the entire time period then equals 50400*10*n = 504000*n ;   n would have to be unreadably small even if the chart were to go on a 12 foot wall.  For 504000 to fit in 12 feet means it fits in 144 inches,  therefore n = 144/504000 = .00028  inches.

We'd need a microscope!

I'll come up with some sort of scrolling idea, using HTML and a projector, I guess.  We can close this topic.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 3 replies
  • 915 views
  • 0 likes
  • 2 in conversation