SSRS limit axis value - reporting-services

I want to limit the max value of the vertical axis to 100 % and not 101%.
I have tried setting the axis limit to 100 but that did not help either. Changing that to 100.05% just changes the axis label but the line does not jump to the top of the chart. Is there a way to restrict the high value of the axis to a particular number?
Follow up question: I see this in ChartDataLabel. What does this mean =IIF(Fields!Reliability.Value >= 100, "", Fields!Reliability.Value) ?

To do what you want, while in design mode, right-click on the axis and choose Vertical Axis Properties. Set the Minimum and Maximum values to what you want.
Now, it sounds like that is something you have already tried, but didn't like the results. Another thing you can do is use the values from the data set, along with an expression, to set the min and max values for the axis. So, instead of setting the min and max values manually, you can try something like the following. This assumes the value you are charting is Fields!Reliability.Value.
Minimum: =Min(Fields!Reliability.Value)
Maximum: =Max(Fields!Reliability.Value)
If you want a little bit of a buffer above and below the value line, then you can add and subtract from those values like this:
Minimum: =Min(Fields!Reliability.Value)*0.95
Maximum: =Max(Fields!Reliability.Value)*1.05
Adjust these as desired.
To answer your follow up question about the ChartDataLabel.
=IIF(Fields!Reliability.Value >= 100, "", Fields!Reliability.Value)
This expression sets the ChartDataLabel to an empty string if the Fields!Reliability.Value from the data set is greater than 100, otherwise it uses whatever value is in Fields!Reliability.Value.
Hope this helps you out.

Related

SSRS - Major/minor gridlines spacing

I have an SSRS report with a bar chart with multiple series by CountryName Category group. What I want to do is have gridlines which split each country like below:
However in SSRS the major gridlines seem to interval with the line in the middle of the country name when the grid interval is set to 1 like below:
Can someone point me in the right direction into how to rectify this?
Also is there a way of adding the X axis in SSRS to start from zero like I have in my first graph?
Thanks
You can do it, there is an offset property on the grid lines (horizontal and vertical are separate). Click one one of the gridlines and look in the properties pane. Change the offset to 0.5.
Gives you this.
I'm not sure what you meant about starting from zero on the X-Axis, you have negative values so you'll start from a negative number. If you meant you wantde zero aligned to the middle. You can do that to. You need to set the min and max values of the horizontal axis to the following
Min Value:
=MAX(ABS(Fields!MyValueField.Value), "MyDataSet")*-1
Max Value will be:
=MAX(ABS(Fields!MyValueField.Value), "MyDataSet")
Basically we take the ABSolute largest value and use that as the extent (*-1 for the min value). The problem is that zero might not show so you'll have to play around with the Axis properties maybe to get that working. I'm sure it's possible but I don't have time to test at the moment.
My test data is not great as the number are large

Barchart is empty when there is no value

I am using html5 stacked bar charts in JasperSoft Studio.
When there is no value to be displayed, the chart is totally empty and the 0 (zero) line in the y axis goes to the upper. It doesnt really stay at the level of origin.
How can I get the bars of the chart even if there is no corresponding data to be displayed. like a thin line on the level of zero?
And how can I take the 0 line back on the x axis?
You can set "Range Axis Min Value Expression" to 0 in the stacked bar-chart properties section.
To add open property panel click on the chart and select Windows --> Properties then add
Range Axis Min Value Expression = 0
I faced a similar problem where the bar was not showing up correctly. So what I did was I set the max and the min value in the customizer class
In my case the range of the bar was from 0 to 1.
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setLowerMargin(0.0);
rangeAxis.setUpperMargin(1.0);
rangeAxis.setRange(0, 1.0);
setting maxto a value is a solution but it has a side-effect for me. It fixes the scale of the axis so if the max value is very big compared to the current data we have, the resulting graph doesnt look nice.
I set minRange to 0.1 and it solved my problem. I didnt need to set max after that.

Getting Value of Y-Axis Max in SSRS

I was wondering if there was anyway to set a value of a data point on a graph equal to the Max auto generated Y-Axis Value. I have a line chart that i display a single vertical stripLine on for a particular date, but i want that stripLine to go all the way to the top of the chart. The best I was able to do is set the value to the Max value in the dataset, which works alright, but doesn't render as i'd hope.
i'd like the vertical black line to extend to the top. I know I can set the value of that to Max(Fields!Demo.Value) + 10000 and it extends up another 10000, but that usually increases the y-axis max value causing the same spacing issue. Also, sometime the values are much smaller such as 1000 being the max as opposed to 10mil like in the above graph.
The only other thing I could think was just a clunky IIF statement saying
if Max(value) > 1,000,000
add 100,000
else if Max(Value) < 1,000,000 and Max(Value) > 500,000
add 50,000
etc...
I understand it'd be in a long IIf() statement, i can figure that out, just seeing if there was any other way by going through the determined y-axis max.

Percentages in SSRS Chart

EDIT: The chart is fixed when I use a stacked chart instead of a stacked percentage chart, but this still doesn't tell me what is wrong with using the percentage chart.
I have a stacked percentage chart which is going from 0 to 10000% instead of 0 to 100%. It appears as if the values are formatted correctly (they add up to 1.01 due to rounding), and even dividing all the values by 100 in the query does not change it.
This is how the chart renders:
with the following Vertical Axis Properties:
I have a table below (with identical number formatting but with 2 percentage points), however that displays as expected:
Finally, here is the raw data set with an additional sum column not reflected in SSRS:
Has anyone come across this issue before? If I manually set the range of the chart from 0-100% (0-1) I can only see that bottom blue series.
Yep. I've seen exactly this. The numbers that the percent chart axis generates are in the range 0 to 100. But when you apply the number formatting as a percent, then the numbers are multiplied by 100 for display.
The trick to fix/work around this is to set the display format to only add the percent sign, not really format the number as a percent. Happily, this requires just one character:
In the Number format for the axis, switch the Category to "Custom." If you just switched from Percentage, you will see something similar to 0%.
Insert a backslash before the percent symbol: 0\% to indicate that you need a literal percent symbol, not to format the number as a percent (multiplied by 100.)
Voila.

Chart issues with SSRS

I am having a problem with getting a stacked area chart to display the right data in SSRS 2005.
On my Y axis, I want a scale from 50% to 100%.
On my X axis I have a set of dates formatted in a style that was necessary for the report (so varchar).
My data consists of 3 data fields which are decimal numbers and contained between 0 and 1, each with a specific date.
My problem is the scale of the Y-axis. I have set the maximum value to 100, the minimum to 50, the interval to 5, and the format to "p" for percentages.
On the preview in the layout tab, this all appears fine (Y-axis starting at 50% up to 100%).
However whenever I generate an actual report it goes from 5000% to 10000% for some reason. I have no idea how this is happening and it completely ruins the report.
I have tried tinkering in the properties for several hours but to no avail.
If this has happened to anyone and they have found a solution, or if anyone has any suggestions I would be very grateful.
Thanks.
When you use percentages, everything factors by 100.
If you want to format and display a value as 50% , it needs to be 0.5 unformatted. Percentages are therefore values between 0 and 1.
Excel and pretty much every other tool works that way.
If your values are all stored as percentages already, then you might just want to append the % symbol at the end of your values. Or better, divide everything by 100.
50 per cent means just that anyway; it means 50 per hundred (cent means 100) so 50/100 is another way of writing 50%.