SSRS 图表中的百分比

问题描述:

当我使用堆积图表而不是堆积百分比图表时,图表是固定的,但这仍然没有告诉我使用百分比图表.

The chart is fixed when I use a stacked chart instead of a stacked percentage chart, but this still doesn't tell me what is wrong with using the percentage chart.

我有一个堆积百分比图表,从 0 到 10000%,而不是从 0 到 100%.看起来好像这些值的格式正确(由于四舍五入,它们加起来为 1.01),即使在查询中将所有值除以 100 也不会改变它.

I have a stacked percentage chart which is going from 0 to 10000% instead of 0 to 100%. It appears as if the values are formatted correctly (they add up to 1.01 due to rounding), and even dividing all the values by 100 in the query does not change it.

这是图表的呈现方式:

具有以下垂直轴属性:

我有一个下表(具有相同的数字格式,但有 2 个百分点),但按预期显示:

I have a table below (with identical number formatting but with 2 percentage points), however that displays as expected:

最后,这里是带有未反映在 SSRS 中的附加总和列的原始数据集:

Finally, here is the raw data set with an additional sum column not reflected in SSRS:

有没有人遇到过这个问题?如果我手动将图表的范围设置为 0-100% (0-1),我只能看到底部的蓝色系列.

Has anyone come across this issue before? If I manually set the range of the chart from 0-100% (0-1) I can only see that bottom blue series.

是的.我已经看到了这一点.百分比图表轴生成的数字在 0 到 100 的范围内.但是当您将数字格式应用为百分比时,数字会乘以 100 进行显示.

Yep. I've seen exactly this. The numbers that the percent chart axis generates are in the range 0 to 100. But when you apply the number formatting as a percent, then the numbers are multiplied by 100 for display.

解决/解决此问题的技巧是将显示格式设置为仅添加百分号,而不是真正将数字格式化为百分比.令人高兴的是,这只需要一个字符:

The trick to fix/work around this is to set the display format to only add the percent sign, not really format the number as a percent. Happily, this requires just one character:

  1. 在轴的数字格式中,将类别切换为自定义".如果您刚刚从百分比切换,您会看到类似于 0% 的内容.
  2. 在百分比符号前插入反斜杠:0\% 表示您需要文字百分比符号,而不是将数字格式化为百分比(乘以 100).
  1. In the Number format for the axis, switch the Category to "Custom." If you just switched from Percentage, you will see something similar to 0%.
  2. Insert a backslash before the percent symbol: 0\% to indicate that you need a literal percent symbol, not to format the number as a percent (multiplied by 100.)

瞧.