BookmarkSubscribeRSS Feed
silversky9
Calcite | Level 5

Hi everyone--

 

I have a dual axis bar-line chart that automatically set the y-axis scale to include a decimal point for the y-variable.  I've searched in Viya and online, but couldn't find an option to manually set the axis scale to not include the decimal point.  When I right-click on the graph, I have no options for the axis scale either.  I checked the format of the variable in both Viya and in the data set in SAS, and the format is BEST12., so no decimals.  I also tested changing the format to COMMA12., and that didn't change the scale either.  The variable itself consists only of whole numbers, there are no data points with decimals in the data set itself for this variable.  I've attached a picture of the graph/scale.  I would like the scale to display as (for example): 0, 2, 4, 6, 8, etc. or 0, 3, 6, 9, etc.  instead of Viya automatically setting the scale.  Does anyone know how I can manually change the axis scale for this graph?  Or if there's a setting I need to select for the graph so that if Viya does automatically set the scale, it won't have these decimal points?

 

Thanks for your help!

5 REPLIES 5
PaigeMiller
Diamond | Level 26

Try format Comma12.0

or

try format 12.0

 

By the way this is not the axis "scale" as you said in your title. Please be kind enough to change the title on your ORIGINAL post to indicate you want zero digits after the decimal point in the numbers on the axis, so others with the same question are more likely to find this thread.

--
Paige Miller
silversky9
Calcite | Level 5

Thank you--I have changed the subject title.  I had already changed the format to COMMA12.0, but that did not change the axis either.  It still displays with one decimal point.  The data points display as they should, as whole numbers without decimals.  Is there another setting I can change to not have the axis automatically display with the decimal?

Tom
Super User Tom
Super User

Can you clarify exactly what type of display you have created and how?  That will help others to show you where the options are.

 

It sounds like you want to change the TIC marks on the X axis.  

From your picture (note in future just paste you picture into the forum or use the Insert Photos icon instead of the attaching a file) the data range is such that evenly placed tick marks resulted in values like 12.5.   

 

You should be able to either set the individual tic marks.  Or just change the upper bound so that the evenly placed tic marks will be at whole numbers.

silversky9
Calcite | Level 5

Hi--I'm using a dual axis bar-line chart.  Under the Data Roles menu: I'm using a categorical variable in 'category', a numerical variable in 'measure(bar)' --this variable is a count/whole number, and a numerical variable in 'measure(line)'--this variable is a rate.  My data points are displaying as expected, i.e., no decimal points in any numerical variable.  I previously tried setting the fixed maximum value for that axis in the Options menu and that results in what I want to see, i.e. whole number tick marks and not 0.5 tick marks.  The issue is that this data is over a number of years, so changing that maximum value for the axis for that graph results in other years now being out of range.  I just want to change the max value for the axis for one specific time point, not for all time points.  The only other tick options I have are to change the text style and color.  I think the only way to achieve this then is by using SAS Studio within Viya?

Ksharp
Super User

Check your option, if there are the following two options within Y axis:

 

proc sgplot data=class;
vbar sex/response=w;
yaxis type=linear integer ;
run;