Is it possible to add items to legend that are not on the chart? - reporting-services

I have a column chart in SSRS with a single series group. The chart is perfect but I need to add a couple of items to the legend even though they are not part of the chart (don't ask). If I add them to the data source with 0 values, the width of my columns still change to reflect the new number of items in my series group.

I ended up using Word to create an image of the proper legend and using this image as my legend. Works great but feels like duct tape.

Related

SSRS single bar-chart

Good day all,
Please am trying to create a SSRS report that looks like the image below
i have my table structure in this manner
Please note the data are not in relation with the chart
But all i could get as a result is a multiple bar chart. that resembles the image below.
Thanks in anticipations of your response
First of all, your "Balance on COC" is negative. That's probably not just a chart visualization issue.
You can format the numbers on the y-axis to be more readable like they are in your first screenshot. Click on the Chart Axis and set the LabelsFormat property to #,0;(#,0).
While numbers in the chart can have up to 16 digits, that is highly unreadable for most people. You might want to consider visualizing the numbers in Billions instead.
To get the labels on the x-axis you'll need to set that field as the Category Group. Then you can delete the legend area from the chart. You can also remove the "Axis Title" areas since they are not needed in this case. This will all make it look more polished like the other image.

Different color chart

I have 2 kinds of charts,pie chart and column chart.
I present the same data of both charts, the problem is that color that presents each equipment is not the same in both of them.
Thanks
The chart legend uses color fields to match the legend items to the
visible data points. The legend can only show one color field per
legend item (data series); hence, it shows the color of the first data
point within that series. Remember this when you use expressions to
dynamically determine the color of individual data points within a
series; the legend item always shows the actual color of the first
data point.
Using the same legend order in both charts should do the trick.
Series are ordered in the legend according to the order that they are
processed by the Reporting Services processing engine. You can change
the order by changing the order of fields in the data fields
drop-zone. If you are using series grouping, the series data is not
known until processing, so that there is no way for you to re-order
these items.
If you're using series, which you probably are, you should make sure they're ordered correctly before sending them to the reporter.
Another solution is to create a custom legend for your charts. Which gives you a lot more control, especially if you define a custom color palette aswell.
You can get more flexibility and control over the legend by generating
your own custom legend by using a table or a matrix. The easiest way
to synchronize the colors in the chart with your custom legend is to
define your own custom chart color palette.
To build a custom legend
Add a table data region to the report.
Place the table next to the chart and bind it to the same dataset as the chart.
Mirror the chart grouping structure in the table by adding table
groups.
If the chart uses series groupings, add them to the table by
adding table groups that are based on the same group expression as
the one in the chart series groupings. Then add chart category
groupings (if present) as inner table groups.
In general, if the
chart has m series grouping and n category grouping, you add m+n
table groups for your custom legend.
For the individual table
groups, make sure to show only the group header (which will contain
the legend description). Also, remove the table detail row unless
you want to use the table detail rows to simulate a chart data
table.
Design the custom legend.
Add a rectangle for the color field of the
custom legend. For example, you might add it to the first table
column. As indicated in step 2, you should only have group header
rows in the table. The rectangle goes into the innermost group
header level.
Set the rectangle BackgroundColor property to the equivalent expression used on the chart data point's fill color. In the most
trivial case, the expression would just contain one grouping value as
in the following code.
=Code.GetColor(Fields!Country.Value)
For the legend text, use either the same expression as in the category and series group/label expressions, or experiment until you
achieve the legend description text that you want.
Sources:
Get More Out of SQL Server Reporting Services Charts
Formatting the Legend on a Chart

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.

SSRS stacked bar chart label position

I am using SQL Server 2012. SSRS
I have a stacked bar charts that includes interest and dividends. I would like to add the sum of these values to the area just above the stacked bar chart. I have tried adjusting various properties for the labels but I can't get the label position to be anywhere but the middle of the stacked bar chart. Any ideas how to get these labels to be just above the stacked bar charts?
I tried the solutions mentioned here and found them cumbersome compared to this gem: http://peltiertech.com/label-totals-on-stacked-charts/
Add a "total" to your dataset (in my case, a percentage)
Add the total series to your stacked bar chart
Change the total series chart type to a line
Hide the line and line markers by setting their fill color to none
Set the Total series to not show in the legend
Set the data point position for your total series to "Top"
Here is my result:
There is not a way to do this with settings.
Here are a couple of links that give you step by step instructions:
http://beyondrelational.com/modules/2/blogs/65/posts/11575/display-total-on-top-of-stacked-chart.aspx
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/654f30c2-ad3a-4b4e-a34f-adf4db6b78d2/stacked-column-chart-total?forum=sqlreportingservices
Basically, the workaround is to create another series or category in your chart that is the totals (which requires updating your dataset to include the totals), make it transparent, and turn data labels on. The MSDN answer says to make it a line chart while the Beyond Relational article leaves it as part of the stacked bar. Either way will work.

Slanted column heading - SSRS reports

Can anyone please tell me if it is possible to create an SSRS 2008 report which has slanted/angled column headers like in the screenshot below?
I've searched for a solution to this, but haven't found anything of use.
In a word, no, SSRS won't do this. 90 degree rotated text is possible as you've probably seen
You actually have two problems:
1. Slanted text.
2. Non rectangle cells.
There are potential workaround to solve the first problem: create a text graphic on the fly, use stylesheet tricks, &c.
But the second problem will be very difficult if not entirely impossible to solve. SSRS, and many of the formats to which it exports, only support rectangle cells.
It is actually possible to create slanted text in SSRS, but not slanted text boxes. Just paste a column chart into the cell, style the horizontal axis as needed to slant the text at the desired angle, and delete all data series and the vertical axis, title and key from the chart.
If the text is to show at the top of a column that repeats in a column group, assign the same dataset to the chart as the body of the table and filter the chart so that only the relevant column of the chart shows in each column of the expanded table. The filter will look like [HeadingFieldName] = [HeadingFieldName], because you are essentially joining the dataset to itself on this column.