Can you force a label on top of a bar chart in SQL Server Reporting Services? - sql

I would like to ensure the labels of my bar chart are above the bars. Can you force a label on top of a bar chart in SQL Server Reporting Services? If so, how?
The issues are the colors are so dark, it's hard to read them if they are not above the bar in the chart. I could just change the colors, but I'd rather learn how to force the label location if possible.
I'd like all numbers to be above the bar, like over the blue bar below. I have over 100 different charts in my report, so the scale will vary greatly depending on the particular report.
Thank you!

In Visual Studio, design mode, ensure that the properties window is visible, then click on any of the labels on the chart.
At this point, the properties window should show the properties for Chart Series Label.
Find the 'Position' property, which probably is showing the value 'Auto', change this value to 'Top' and this should do the trick.

You have to first make sure the chart type is not stacked.
In my experience the "Position" property doesn't always work.
Sometimes you have to go to the properties of the series, then "Custom Attributes", then "Label Style" then select "Top".
What #niktrs said in the comments of the other answer about setting the AllowOutsidePlotArea property is also true.

Microsoft do not use the label Position property for some of the chart types.
They tell us what they use by default here - in your case "on bar charts labels are placed outside of the bars that represent data points" (they appear to mean "column charts")...but sometimes with a large value it's placed just inside, sometimes partially in-out (and if you try the "Outside" position it just fails to render!).
As #jayvee has mentioned the trick with Column charts is to select the value and change the SmartLabels AllowOutSidePlotArea to True (from Partial).
However if you have a Stacked Bar chart then labels are always in the centre of the particular value.
The hack to get labels on top is to add an extra Stacked Bar value with the Color set to "No Color" and move it to the top of the values (using the Chart Data designer arrows).
The trick is getting a good expression value to use - a constant ends up too big or too small at some point, so I found a percentage of the stacked values works best (remembering to change Nulls to Zeros)...25% to 30% usually works.
Then set the value Label to the value you want to display in the data label.

I just had this issue, I was able to fix it by making sure the chart series "Smart Labels" - "Disabled" property was set to "True"
This is what my properties pane looks like:

Related

Match two trellis pages between two different graphs

I want to have on the same page a pie chart and a bar chart, with trellis pages.
They both have 5 columns as trellis, so 5 different pages that you can visualize by scrolling down.
However, I would like to display the same pages at the same time for both graphs. For instance, let's imagine I'm on the pie chart, I scroll down one page - and so my pie chart is on page2 - I want my bar chart to automatically go to page 2 as well
I tried to use markings but although it links a bit the two graphs, it doesn't change the trellis pages automatically
Does anyone know how to do this ?
as #scsimon mentions, there's no native feature (nor API method, AFAIK) for this using a trellis. however, you can create a Property Control (I'd use a dropdown) in a Text Area, then use the same Document Property to your chart in a Limit By expression.
little more detail, assuming a data table like this:
A B CATEGORY
1 2 red
3 4 red
5 6 green
7 8 green
9 10 blue
11 12 blue
add a Text Area to the page and edit its contents
add a Property Control
click New to create a Document Property, give it a type String and a name category
change Set property value through to Unique values in column and choose the "category" column and click OK
save the Text Area contents
in your Pie Chart's Properties dialog, go to the Data page and look for Limit data using expression. click Edit
set the expression to: [CATEGORY] = "${category}" (don't forget the quotes or the Document Property won't be treated as a string and you'll get an error)
repeat steps 6 & 7 for your other chart
As #scsimon mentioned in the comments, it seems to be impossible. I found a way to have a similar representation though without using trellis visualization, by using text arena
I created a list box that contains the 5 columns I want to visualize, and then I select this list box as the vertical axis variable of the bar chart and the sector size of the pie chart
Then, by clicking on my list box, I can have a synchronized Pie chart and Bar chart (a bit different from what I expected but it also has some advantages like a multiple scale since a new graph is generated independently of the other variables)

How to change the color of bar chart in Pentaho Report designer based on the value

I have a simple requirement wherein I would like to change the color of the bar chart in Pentaho report designer based on the value of y-axis. In case the number is negative, I would like to show it as a red bar, in case the value is positive, I would like to show this as a green bar.
I took a look at the following example but the color changes based on the values proximity to a goal of 1 million. I am pretty new to bean shell scripting and would really appreciate any inputs on the same: http://type-exit.org/adventures-with-open-source-bi/2011/05/dynamic-coloring-of-prd-charts/#downloads
Thank you,
Malavika

Edit Pop-ups on QlikView Chart

I have an expression Sum of Cycle Times in a bar chart. I want to display the equation used to calculate the value of the expression when I hover over the bar in the chart. Right now, the pop-up box displays the dimension value and the expression value. Can I edit what is displayed in the pop-up?
You can create a new expression with your expression formula in quotes and set it to 'Text as Pop-up'. This is a common practice in Qlikview charts as a means to get custom pop-up text. It's still not a perfect solution, but it will take care of your problem.

rdlc: Display percentage on pie chart

I'm using Visual Studio 2010 reporting to generate a report which has a table and a pie chart. Both work just fine except that for the pie chart, I'm to put the % value on each pie chart slice.
1. Is this even possible?
2. If it is, how do I do it?
Thanks
To put the % value on each pie chart slice do this (as shown here):
On the design surface, right-click on the pie and select Show Data Labels. The data labels should appear within each slice on the pie chart.
On the design surface, right-click on the labels and select Series Label Properties. The Series Label Properties dialog box appears.
Type #PERCENT for the Label data option.
Beware: If you use multiple data fields like this:
you need to move every field to first position and perform above steps as shown here otherwise you end up with only one pie chart slice showing the percentage and the others are blank...

Why can't I set DataLabel.Position to xlLabelPositionCustom?

I am working with vb.net and excel 2007 to create some graphs for myself. I wanted to set the datalabel positions to a custom value since the default above position (xlLabelPositionAbove) causes the labels to clash with error bars and the default option for a side (such as xlLabelPositionRight) may leave the label over another point or other errorbar. Due to this, I wanted to set the label to a custom position where it is off to about a 45 degree angle to the top right (like right in the middle of where the default above and right positions would place it).
I tried doing this by adjusting xlMySeries.Points(index).DataLabel.Top and xlMySeries.Points(index).DataLabel.Left at first, however I ran into an undescriptive error leading me to believe I was not doing things correctly. I then thought to try setting xlMySeries.DataLabels.Position = xlLabelPositionCustom and then adjusting top and left. However, to my surprise, I could not even change xlMySeries.DataLabels.Position to xlLabelPositionCustom!
Whenever I try to adjust top, left, or the position to certain datalabel positions, I get HRESULT: 0x80004005 (E_FAIL), which I have generally found to mean "You are doing it wrong" in my experience so far with excel. I cannot set the position member to custom, or anything other than just above, left, right, center (so not bestfit, custom, or any inside___ one)
Any idea why I cannot set the position property to what I need it or otherwise change the position of my datalabels? I just need SOME way to adjust the positioning of my datalabels to a custom psoition (or position other than above, left, right, center, bottum). Thanks in advance!
You can set positions only to whose which you can see on the Data Label properties window.