How to set fixed colors for series legend? - telerik-reporting

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.

Related

How to fix pie charts size in SSRS

I have 4 charts created in SSRS 2017 and I need them to be the same size.
Are there any settings (and where? in SSRS) to make size all the same for all of my 4 charts?
When I go into Chart Area properties, there is nothing about the chart size...
Please help!
Update:
When I clicking on the Chart Area slightly outside the actual chart I see the following Chart Properties:
You can control the position of the chart area and the plot position of the pie within the area by setting the CustomPosition and CustomInnerPlotPosition properties. Select the chart area first to see these properties.
Please note: You must select the CHART AREA object in the designer not the chart Just click slightly outside the pie to select the correct area then you will see these properties.
You can do the same for the legend too if required so you can get full control over the final rendered size.
It does take a bit of trial and error to get a layout that suits all your needs but it can be done.
You cant directly influence the size of the chart, like Hannover Fist said it depends on multiple conditions (for example the legend). What you can do is to put the legend on top or on bottom of the chart (the reason for the different sizes of your charts it that the legend text from right to left is different, thus it uses the space from the visual). This way the size of the chart should be more or less the same size. Right click on your legend Legend properties > General > Legend position. With the MaxAutoSize property from the legend you can a little bit control the size of your legend.
To your second question. No, a chart (also tablix and matrix) can only have one Dataset as source. You can see this in the chart properties at the drop down list. You just can chose one element. But you can create one big dataset with all the data for the different charts. Then assign this dataset to one chart and copy it. And then you set different filters to the charts.
For me the above didn't help. The varying sizes of pie charts related to the fact that some had been set to have their series value > label > position = outside and others were position = auto. All pie charts had their labels hidden so you coudln't see them at all but SSRS was allowing space for them when set to position = outside. This made it extremely frustrating to chase down where the difference in size was coming from. Hope this may help someone who comes across a similar issue.

SSRS range chart series labels overlap and do not align left

I have built a "gantt" style range chart in SSRS using Narayana Palla's model. I am using date parameters to view the data by a date range - my dataset is museum exhibitions over a number of years. I have opted to use the DrawSideBySide = false custom attribute to display series data but I can not position the series labels as I want. I want them to align left however they align right and overlap with each other. I have tried many different combinations of properties including the smartlabel properties but can not impact on the position of the labels in the series. I have not been able to find a solution in my searching.
I would be happy to have my series displayed using DrawSideBySide = true but the bars are so narrow that neither they nor their labels can be seen. Again I have tried many combinations of properties to set the width of the bars but to no avail. I believe this is due to the number or series in the whole of my chart / dataset.
I would like advice on :
1. How to adjust the position of the labels in the series OR
2. How to fix the width of the series bars so that I can see them on my chart OR
3. If I am right about the size of the data set making the bars miniscule how can I best resolve this - say group on year so that only a limited (and therefore hopefully wide) set of series bars appear at a time from page to page.
Very grateful for any assistance, Sally
In SSRS, for the label overlapping issues, the only way is manually changing the chart area size to make enough space for those labels. Otherwise we have change an appropriate chart type.

Changing properties for multiple fields at once in SSRS Designer

This is very similar to the post on Formatting multiple fields at once in RDL, but there are still issues with setting properties like Size.Width and Font.FontSize when the underlying data is different between selected cells.
Here's the accepted answer:
Select all the controls in the designer and press F4 for properties. Change the background color
But if falls short when there is a property that is made up of several child properties. Here's an example using font and size, each of which are comprised of several properties.
This is what it looks like when a single field is selected or when multiple fields are selected that all have the same value:
But if I highlight several cells that have different font sizes, or widths, I lose the ability to edit them all simultaneously. For example if I wanted to make consistent column widths across an entire report.
Here's what the properties look like when multiple fields are selected and any of them have a different value:
It's not ideal, but in the case of the size property, I can enter the shorthand value which includes both width and height separated by a comma and it will apply that change to all the selected cells.
But for some reason, in the Font section, I can't even do that.
Other things I've tried:
Using the Formatting Toolbar - which seems to be always greyed out for SSRS:
Using the Formatting Menu Item - which doesn't expose the FontSize property:
Using the Context Menu to enter the Properties Form, which is disabled:
They will be greyed out if they are not identical in all fields selected. This can depend on a related formatting field being different.
One workaround is to create an internal text parameter:
With default value of the value you want to use for the property:
Then set the property for each cell that should have the same formatting to this parameter individually:
Repeat this for each of the relevant child properties, you will then be able to change formatting across the report by changing the parameters.

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.

Alternate Row shading : Business Objects - WebIntelligence

I am a n00b on WebI.
Could somebody please tell me how to do alternate row shading in a BO CrossTab.
Thanks
You don't say what version you are using, but in XI R2 and above it is automatically applied to a block. To manually apply it, select the block (dotted border around the entire crosstab), then in the properties under Display, is a set of options called Alternate Row/Color. Specify the colour for the non-white rows, and the frequency tells XI how often to apply the alternate colour.
In previous versions you can create a new variable with the following code:
=Mod(LineNumber(),2)
And then add an alerter to the crosstab to set the background colour to your alternative colour whenever this variable equals 1 (i.e. for odd rows).
I'm creating a web intelligence report in BO XI 3.0, I need to create blocks with a required alternative colour(239,239,239) in the rows. When i try to change the default colour (240,240,240) of non-white rows to any other colour, the colours are applied to all the body cells in all rows of block. I checked the frequency aswell, it is set to 2. But i'm not sure why is this issue..??