BookmarkSubscribeRSS Feed
Vrin
Calcite | Level 5

Hello,

I'm attempting to produce a bar chart with both a group and sub-group variable.  My issue is that the sub-group variable values get truncated at 32 characters, which causes some odd groupings on the chart.  I've looked at support.sas.com and also in the communities site to see if there is a resolution for this but from what I can tell this issue was meant to be fixed in SAS 9.2. 

I'm currently working with SAS 9.2 and EG 7.1.  We have plans to upgrade to SAS 9.4 in the fall but we're not quite there yet.

Any suggestions would be greatly appreciated.

Thank you,

Pearl

Note:  I've copied in the code generated from the chart task below.

PROC SORT

  DATA=WORK.CHART_DATA_HASP_FINAL(FIRSTOBS=1  KEEP=TIME_INTV_1 FLOWGATE_NAME SHADOW_PRICE EDR_TRADE_DT)

  OUT=WORK.SORTTempTableSorted

  ;

  BY DESCENDING EDR_TRADE_DT;

RUN;

%_sas_pushchartsize(450,300);

  GOPTIONS CBACK=WHITE;

Legend1

  FRAME

  LABEL=( FONT='Arial' HEIGHT=8pt JUSTIFY=LEFT   " ")

  ;

Axis1

  STYLE=1

  WIDTH=1

  MINOR=NONE

  LABEL=(  ANGLE=90 "Shadow Value ($/MW)")

;

Axis2

  STYLE=1

  WIDTH=1

  VALUE=(ANGLE=90)

  LABEL=NONE

;

TITLE;

FOOTNOTE;

PROC GCHART DATA=WORK.SORTTempTableSorted

;

  VBAR

  TIME_INTV_1

/

  SUMVAR=SHADOW_PRICE

  SUBGROUP=FLOWGATE_NAME

  CLIPREF

FRAME CFRAME=WHITE

  MIDPOINTS="0:00"T TO "23:45"T BY "0:15"T

  TYPE=SUM

  MISSING

  LEGEND=LEGEND1

  COUTLINE=SAME

  RAXIS=AXIS1

  MAXIS=AXIS2

  LREF=1

  CREF=LTGRAY

  AUTOREF

;

  FORMAT TIME_INTV_1 HHMM5.

  SHADOW_PRICE DOLLAR8.;

  LABEL

  FLOWGATE_NAME="Constraint"

  SHADOW_PRICE="Shadow Value"

  EDR_TRADE_DT="Trade Date";

  BY DESCENDING EDR_TRADE_DT;

/* -------------------------------------------------------------------

   End of task code

   ------------------------------------------------------------------- */

RUN; QUIT;

2 REPLIES 2
ballardw
Super User

I would try putting the full text into an ORDER or VALUE statement in the legend and see what happens. You don't mention how many levels you have for your subgroup but if the graph size is small ( is that 450 by 300 pixels?) then you may have issues with space available so font and size for the values might be critical.

Vrin
Calcite | Level 5

Hi BallardW,

Thanks for your reply.  From what I can tell this isn't simply a display issue, but rather a grouping issue, so that while I start out with ten sub-groups per day, some of them get grouped together so that only 8 or 9 show up on the chart since the names are identical until the last few characters which happen to be past the 32-character limit.  This makes the values identical after they get truncated, so they get grouped together erroneously.  Unfortunately I can't recode the values to be shorter since these names are already modified as much as possible from the original, so I can't shorten them to get around the 32-character limit.

Thanks again,

Pearl

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 1162 views
  • 0 likes
  • 2 in conversation