Fill legend squares when using line type chart with vega-lite - vega-lite

When I set my chart as type line it renders the legend without a filled color:
Is there a way I can have the squares from the legend filled (with the same color as the border)?

Related

SSRS Treemap Label Text Properties

I created a treemap in SSRS.
I am using the Series Label to display text in the box in the lower left corner.
I am also displaying other text in the upper left corner with the Label property of the Series Group.
The properties of the Series Label seem to control the Series Group label in the top except for the Weight - it's always Bold and looks blocky.
Are there any properties for the Series Group Label? How do I get rid of the Bold in the font?

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 Expression for Cell backgound color based on cell to the left

I'm trying to write a field expression for a Cells in my report where I have to change the background color of the cell depending on the value in the cell to the left. Ex: if the cell to the left does not have the same vaule in it, the cell should show a red background color.
I tried the following:
=IIF(Fields!cell.Value, cell.left "value", "Red")
Image for the example is this,
There's not a way to refer to certain cells within a table in SSRS.
I think the best way to do this would be to use the same expression that you are using the two cells in your comparison for the Background Color expression.
=IIF(Fields!Lot_QTY.Value = Fields!Allocated_QTY.Value, "White", "Red")
Your data might be using a SUM:
=IIF(SUM(Fields!Lot_QTY.Value) = SUM(Fields!Allocated_QTY.Value), "White", "Red")
The only issue is if you are using a matrix for the data but that doesn't seem likely given your data.
The text box Expression is where you put the value to display in the cell. The properties are used to control things like the BackgroundColor, Font Color, Font Weight, cell border color...

SSRS bar chart custom grid line color with expression

I have a bar chart, the values are percentage. I want the 100% grid line to be a standout color like blue rather than the default grayish "Gainsboro".
I tried to use expression for the line color in "Chart Gridlines" dialog, but how do I know "current" line is 100%?
By adding a strip line, we can do it.
Select Value Axis
Click "StripLines"
Click "Add"
Set "BackgroundColor" and "BorderColor" you want.
Set "BorderWidth" so make it standout, I set it to 2pt.
Set "IntervalOffset". I set it to 1 because I want 100% is the target (1 = 100%).
do NOT change "StripWidth" otherwise it will not acurately aligned on the number you want!
Bit of a hack but how about adding a series with all 100% for each data point, then you could choose the colour of the series and make it as thick and as dark as you want

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.