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

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.

Related

SSRS - Indicator and value in same cell?

I have created a Directional indicator (Green up arrow and Red down arrow) in my SSRS report, referring to the value of the column next to it. This all works ok:
However, I really want the indicator and the value to be in the same cell, like Excel can:
A Google found the following article , where the last post suggest it is possible using the following syntax:
=Format(Fields!Column1.Value, "Format") + " " + "Indicator"
I assume "Indicator" refers to the name I gave to my Direction indicator, but I can't get it to work..
I have read that by using border formatting I can get my two cells to look like one, but I would ideally like it all to be in one.
Any thoughts appreciated!
Mark
I would do this by placing a Rectangle inside of the cell and place your indicator along with another text box inside the rectangle. The downside to this is (depending on how you align the items in the rectangle) the formatting may cause split cells in excel exports.
Ross's method will work and there are alternatives..
The article you referenced was a text indicator not an image (from what I could tell).
You could do something similar by simply adding a a placeholder in the cell (right-click inside the cell and click "create placeholder"). You can then set the font and colour independently from the rest of the cell.
You could use a common font such as wingdings to get arrows and then the value and color properties would be expressions to show the correct 'character' (arrow) and the correct colour.

Access 2013 - Conditional Formatting for checkboxes

I have a continuous subform in a form that shows several reminders - it has roughly 6 columns, and the last column has checkboxes where you can check it off if the reminder is complete. Is it possible to color the box if the last column is checked?
This is a great question! +1! (some people seem to give -1 everywhere)
Conditional formatting is limited to the formatting of text only, so you cant color the check box or its background directly.
Here is a full solution that doesn't even require VBA:
Place a new TextBox over your CheckBox an delete its label
Set it to background so it doesn't cover your CheckBox
Bind that TextBox to the same data field as your CheckBox
Set its font color to white (on white background since you don't want to see the text)
Disable it (since you don't want to enter data here)
Also deactivate it (since you don't even want to place the cursor here)
Now set the Conditional Formatting of this TextBox:
1st Condition: If equals 0 then set background AND font color to white
2nd Condition: If equals -1 then set background AND font color to i.e. red
looks great:

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:

How to set fixed colors for series legend?

I am using Telerik Reporting and creating reports with Report Designer.
What I want to do is set fixed colors for specific series elements.
For instance, in a monthly financial bar chart, if the series is Company, I want to set ElectricityCost as red and WaterCost as Blue all the time. The problem is that not every bar has all types of the cost, and for a specified time range, not all types will be included, which causes that the color legend varies.
I've tried some approaches but failed.
Is there anyone who knows how can I achieve this goal?
Finally I find how to set the color for specific series.
The data points' color can be set by using the Graph.Series.BarSeries.DataPointConditionalFormatting property.
The legend markers' color can be set by using the Graph.Series.BarSeries.LegendItem.MarkConditionalFormatting property.
Besides the color, other styles can also be set so that for a certain series, the style will not change even no data is displayed after the filtering.

Target reference for each bar in Spotfire

In Spotfire:
Is it possible to show target value reference line for each bar in a bar chart.
A way around that i am doing now is using combination chart. Refer screenshot.
The problem here is that now i can not define a color by property to color bars using rules.
I don't believe you can do it automatically without scripting but here is an example of how to do it by hand.
Right click on your bar chart and go to the Lines & Curves section:
Here you can see I've added 4 lines based on percentage of the data.
You can do this or add lines of set values using the Add button in the top right and selecting Horizontal Line.
Notice I've added the line name as the description of the percentage it is, hovering over will show an actual value so it may better to do this if it isn't clear what the value represents.
This is what it produces:
To make it better match your question I've added 2 more employees and coloured by employee instead, I've also set fixed targets for each person rather than percentages and renamed them to make sure it is clear which line applies to which person in case the colour isn't enough.
Using the Settings -> Appearance section back in the first picture change the colour of the lines to match the fields they represent.
Like I said at the start you should be able to create a script to do this for you but that is another question.