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

I would like to set the Yaxis  start and end values to 15Sep2013 and 30Sep2013. I would like to see the activity for each day. what should be the increment value then? I have it as 1. But it is not working. Thanks.

The code i am using is below:

proc template;

  define statgraph dyn_scatter;

    dynamic _x _y _grp _valign;

    begingraph;

      entrytitle '_x';

      layout overlay/yaxisopts=(label='Month' linearopts=(tickvaluesequence=(start="15Sep2013"d end="30Sep2013"d increment=1)))

  xaxisopts=(label='Check Amount' linearopts=(tickvaluesequence=(start=0 end=200000 increment=20000) viewmin=0 ));

        scatterplot x=check_amount y=date / group=status datatransparency=0.1

               name='a' markerattrs=(symbol=circlefilled size=10);

        if (exists(_grp))

          discretelegend 'a' / location=inside

              valign=_valign halign=right across=1;

        endif;

      endlayout;

    endgraph;

  end;

run;

proc sgrender data=CRO_Final_Paymentfile template=dyn_scatter;

dynamic _x='Check_Amount' _y='Date' _grp='Status' _valign='Top';

run;


Temp.png
1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

It is hard to say what is going on without the data.  Please attach data.

If the variable "Date" has a SAS time format, then your Y axis will be of TYPE=Time by default, and you should use the TIMEOPTS bundle, with VIEWMIN, VIEWMAX and INTERVAL..

View solution in original post

6 REPLIES 6
Jay54
Meteorite | Level 14

It is hard to say what is going on without the data.  Please attach data.

If the variable "Date" has a SAS time format, then your Y axis will be of TYPE=Time by default, and you should use the TIMEOPTS bundle, with VIEWMIN, VIEWMAX and INTERVAL..

skyrocket
Calcite | Level 5

I have date values which i plotted along Y axis in date9. format. the date values range from 17Sep2013 to 15Apr2014. Thanks Sanjay!

skyrocket
Calcite | Level 5

Thanks Sanjay. Timeopts worked.

skyrocket
Calcite | Level 5

is there an option to set the color for variable used with group ? i have 3 different values for the group=status variable. I dont like the default colors:). Thanks.

proc template;

  define statgraph dyn_scatter;

    dynamic _x _y _grp _valign;

    begingraph;

      entrytitle 'Check Activity Month 1';

      layout overlay/xaxisopts=(linearopts=(tickvalueformat=Dollar12. viewmin=0 viewmax=250000 tickvaluelist=(25000 50000 100000 150000 200000 205000 )))

  yaxisopts=(timeopts=(tickvalueformat=date9. viewmin="15Sep2013"d viewmax="15Oct2013"d tickvaluelist=("15Sep2013"d "30Sep2013"d "15Oct2013"d )));

        scatterplot x=check_amount y=date / group=status datatransparency=0.2 name='a' markerattrs=(symbol=trianglefilled size=10);

        if (exists(_grp)) discretelegend 'a' / location=inside

              valign=_valign halign=right across=1;

        endif;

      endlayout;

    endgraph;

  end;

run;

ballardw
Super User

Colors are defined in the ODS style active when making the graph. Either try other styles or make a custom one with desired colors. You'll need to check with the documentation as to which elements to change as some use graphdatacolor and some use contrastcolor.

Jay54
Meteorite | Level 14

For those using SAS 9.4 or later, group colors (and symbols and line patterns) can be defined in the SG (StyleAttrs) or GTL (BeginGraph) code.  So, while deriving a custom style is still a good way, it is no longer necessary.

Generally, filled areas (Bars, Bands, etc.) use DATACOLORS and lines and markers use DATACONTRASTCOLOR.

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
  • 6 replies
  • 1718 views
  • 0 likes
  • 3 in conversation