问题描述
我有一个 SQL Server Reporting Services (2008) 图表(错误图表).X 轴的日期间隔为 1/1/2009、2/1/2009 等.Y 轴的数字间隔为 50.Y 轴上的值为 0、50 和 100.但是,不是显示 0, 50 和 100 我想分别显示小"、中"和大".有谁知道如何进行这种文本替换?
I have a SQL Server Reporting Services (2008) chart (error chart). The X-axis has date intervals 1/1/2009, 2/1/2009, etc. The Y-axis has numeric intervals of 50. Values on the Y-axis are 0, 50 and 100. However, instead of displaying 0, 50 and 100 i would like to display "Small","Medium" and "Large" respectively. Does anyone know how this text replacement can be performed?
推荐答案
这有点小技巧,但这里是:
This is a bit of a hack, but here goes:
首先,将您的值标准化到零附近,因此最小值为 -50,最大值为 50.您可以在图表控件本身中执行此操作,无需更改您的数据集.您的值介于 0 到 100 之间,因此只需减去 50.
First, normalize your values around zero, so the smallest value is -50 and the largest value is 50. You can do this in the chart control itself, no need to change your dataset. Your values are between 0 and 100, so just subtract 50.
接下来,在值轴属性 -> 轴选项下,将最小值设置为 -50,最大值设置为 50,间隔设置为 50.
Next, under value axis properties -> axis options, set your minimum to -50, maximum to 50, and interval to 50.
最后,在值轴属性 -> 数字下,选择类别为自定义",并将其作为自定义格式表达式输入:="Large;Small;Medium"
Finally, under value axis properties -> Number, select Category as "Custom" and enter this in as the custom format expression: ="Large;Small;Medium"
(这是一个excel格式代码:pos;neg;zero)
(that's an excel format code: pos;neg;zero)
你应该得到这样的东西:
You should get something like this:
替代文字 http://img44.imageshack.us/img44/9011/chartz.png
这篇关于Reporting Services 图表 - 自定义轴标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!