What am I missing? I'm putting a bar chart together with a line graph, both have months for the X axis, so that totally works. I'm getting exactly what I want, except I'm getting no legend, I was expecting a legend that distinguished the different lines from the series plot.
define statgraph vbar_line;
dynamic _title _Xbar _Ybar _xseries _yseries _seriesGroup _seriesTitle;
layout overlay/xaxisopts=(type=time timeopts=(interval=quarter TICKVALUEFORMAT=MONYY5.))
barchart x=_xbar y=_ybar/ yaxis=y;
seriesplot x=_xseries y=_yseries / group=_seriesGroup name="series" yaxis=y2
Did you check for log messages? If you have a large number of groups, the legend may get too big to display by default. You can increase the space allowed for the legend. Please include full program with data that can be shared so we can run the case and see what is happening.
I'm pretty sure the problem is too many groups. I only have 5 lines, I only calculated the percent for the lines for the 5 groups that I need, but it appears SAS is trying to put all the groups in the legend even though there are no lines drawn for them.
I'm having to alter the data a lot, but I'm able to get what I need by eliminating the grouping variable on the rows for data that don't contribute to the 5 lines I want (but I can't delete the rows of data wholly because they contribute to the bar chart)
Thanks, no errors in the log, this was a tricky one, I figured 5 should be able to fit in the legend, didn't know it was trying to all the other groups.
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.
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.