SSRS hide negative values from scale - reporting-services

I need to hide specific values from the scale in a line chart.
The report should load from -10 to the automatic Maxim but Hiding negative values.
My series are all positive so I can't base my expression on it.
I thought to colour these negative values of white or no colour but I don't know the way to get the current scale value.
Temporarily I checked the "hide first and last labels along this axis" checkbox but it is not the way because It is subject to rescale showing other negative values for example as second element.

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

ssrs change background color of line chart

I'm developing a report in which I have to highlight a particular period on a line chart.
To be more precise if the dates in the x axis are more than a given date the chart background colour after that date will have to be light green otherwise white.
Here is the expression
=IIF(Fields!Week_Day_Of.Value>Fields!startdate.Value,"LightGreen","#00000000")
I have put the expression in the chart area properties (Fill).
Fields!Week_Day_Of.Value represents the values on the X axis.
Fields!startdate.Value represents the parameter beyond which the cart has to turn light green.
It's not doing anything
As far as I am aware, you cannot fill parts of the chart background like this. Your best bet is to add another column data series on the secondary vertical axis that has a value of 1 or 0 depending on the expression you have above and set the colour of the series to whatever you need. To get the columns wide enough to form a solid block of colour, you will need to set the CustomAttributes -> MinPixelPointWidth property to 100.
You can then set the secondary axis to hidden by right clicking on the chart area and unchecking Show Secondary Vertical Axis and check the Do not show this series in a legend option in the Legend area of the series properties.
Do all this and your chart will look something like this:

SSRS - How to align the vertical axis of 2 chart areas on the one chart

I have basically loosely followed this link
http://www.angelsbiblog.com/2012/02/improve-data-visualization-in-your-ssrs.html
and made the below linked graph. Its one dataset, I have simply pulled in Gross Profit and Sales fields. Neither are calculated fields. I put them in 2 different chart areas, but then as per that link, made the chart areas the same size so they overlay.
*Apologies for a photobucket link instead of inserted image but I don't have 10 reputation points to be able to insert images.
http://i1375.photobucket.com/albums/ag447/AndrewJacksons/IncomeandProfit_zpse074ac02.jpg
what I want to do, is as illustrated by that inserted green arrow in the graph image, is raise up the Zero line for the Income bars (yellow) to the same level as the Profit/Loss(Blue-Red).
I also want the vertical axis to preferably have the same axis, so i dont have to have that secondary axis on the right.
However the main thing is the graphs sharing their zero line. I have made the Profit bars smaller I width than the yellow bars, so in a month of blue profit, it would simply sit neatly inside the yellow income bar.
I haven't added expenses because it should be obvious what they are by the height differential btw Income to Profit or to the Loss.
Any ideas much appreciated.
I have just experienced this problem, but this page did not solve it.
Dan's answer ("simply set the minimum and maximum values for the vertical axes on both areas manually") came close, but did not solve the problem for me because I needed the axis to be automatically calculated. If the maximum of the two datasets is something like 193,456 then you get that exact value as a label on the axis rather than the sensible value of 200,000.
The solution is to allow SSRS to calculate the axis labels automatically but to trick it by using both sets of data in each chart. Then you hide the data set that you don't want the user to see.
In each chart I made the data series of interest a column chart and the other data series a line chart (without markers), as all you need to do is set the fill color for the line series to None. If you try the same with columns for the other series the invisible columns affect the position of the visible columns even if they have been set to zero width.
Make sure both series in the chart use the Primary Vertical axis. Go into properties for the Income series > Go to "Axes and Chart Area", and make sure that the series uses the primary vertical axis:

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.

In SSRS how to conditionally change the colour of a datalabel font on a chart when it appears on the bar

I have created a bar chart that shows values on data labels.
The Data label is placed outside the bar
But in some cases the label appears on the bar where the bar is too long.
In this scenario I would like to conditionally change the font/colour of the data label so that it's more visible.
However I can't see a way to dynamically determine where the label has been placed.
What I can think of is this. You can change the background/font color of all those series labels who's value lies in the range of 95%-100% of the maximum "Value". To be exactly precise as to what should be the threshold to change the bg/font color seems a daunting task, but you could play around with test data.
For writing the expression to change the font color,I would first change the dataset and add a column on the lines of PercOfMax. This column can be calculated easily in the dataset by using basic aggregate functions.
Then you need to go to the Chart Series Label properties-->Color and write the expression on the lines of -
=IIF(Fields!PercOfMax.Value>=95, "YELLOW", "BLACK")
As I said, you might need to do some more research to finalize the value of this threshold(which I am assuming to be 95).
Another solution to this problem is to use fill colour of the label and set its background to a bright colour (e.g. colour), and leave the font colour of the label black. Thus you can always see the label, and there is no difference when it's outside of the bar.