reporting-services - SSRS : Custom bar width between multi-level categories

标签 reporting-services ssrs-2008 bar-chart

我有一个包含多个类别组的条形图,我需要增加第一级类别组之间的间距,即蓝色箭头指向的位置。

我想改变这个:

SSRS bar chart

进入这个:

SSRS bar chart

提前致谢。

最佳答案

据我所知,没有办法调整自我强加的酒吧组之间的间距。但是,有一个技巧可以获得所需的效果。你所要做的就是欺骗SSRS。在您的查询中,您需要创建没有标签的空条。在不知道您的查询是如何构建的情况下,您可以这样做:

Select 'Group 1' as Group_Label --This would be equivalent to your Recursos or Credito Pessoal
    , 'Bar 1' as Bar_Label --This would be like T-3
    , 10 as Value_1 --This would be like the Red part of the bar
    , 20 as Value_2
    , '1' as Bar_Sort --This will come in handy later

Union All

Select 'Group 2' as Group_Label --This would be equivalent to your Recursos or Credito Pessoal
    , 'Bar 1' as Bar_Label --This would be like T-3
    , 15 as Value_1 --This would be like the Red part of the bar
    , 30 as Value_2
    , '2' as Bar_Sort --This will come in handy later

Union All

Select '' as Group_Label
    , '' as Bar_Label
    , 0 as Value_1
    , 0 as Value_2
    , 1.5 as Bar_Sort

Order by Bar_Sort

如果您进行设置,您将得到的是 Group 1 Bar 1 后跟一个空条(没有标签),然后是 Group 2 Bar 1。这将用户看到的内容作为条组之间的明确空间,但是你知道这真的只是一组空的值。我已经多次成功地将它用于条形图。

如果这对您没有意义,请创建一个 SQLfiddle示例,我可以帮助您调整代码以使其正常工作。

关于reporting-services - SSRS : Custom bar width between multi-level categories,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21833783/

相关文章:

asp.net - 如何使用基于数据表的单元格重复 Tablix

javascript - xCharts 按星期几排序

sql - 从 Reporting Services 导入时在 Excel 中按日期排序

sql-server - 如何让子组跨越三列?

reporting-services - SSRS 中的 DB2 数据源

ssrs-2008 - SSRS表达式中的WHERE子句

dynamics-crm-2011 - 如何将 SSRS 报告部署到包含 SQL Server 数据源和 T-SQL 查询的 CRM 2011 Online?

reporting-services - SSRS隐藏#错误显示在单元格中

python - Bokeh 100% 堆叠条形图

javascript - 将股票代码添加到 Flot 条形图中