【问题标题】:Series colours are different to legend colours in chart系列颜色与图表中的图例颜色不同
【发布时间】:2017-10-04 23:48:06
【问题描述】:

我正在使用以下查询构建事件报告:

SELECT Incident_Logged
      ,Location_Name
      ,Incident_Type
      ,Body_Part_Name
FROM Incident
INNER JOIN Location ON Location_ID = Incident_Location_ID
INNER JOIN Body_Part ON Body_Part_ID = Incident_Body_Part_ID
WHERE Incident_Logged BETWEEN @StartDate and @EndDate
AND Incident_Location_ID IN (@Location)
ORDER BY Incident_Logged DESC

我还创建了一个图表,但由于某种原因,图表中的颜色与图例不一致。有什么想法吗?

【问题讨论】:

    标签: sql sql-server reporting-services charts ssrs-2008-r2


    【解决方案1】:

    原来这是一个 feature bug 已知问题,如果您使用 COUNT() 聚合就会发生。我通过在查询中添加一个值为 1 的伪列解决了这个问题:

    SELECT Incident_Logged
          ,Location_Name
          ,Incident_Type
          ,Body_Part_Name
          ,1 Incident_Sum
    FROM Incident
    INNER JOIN Location ON Location_ID = Incident_Location_ID
    INNER JOIN Body_Part ON Body_Part_ID = Incident_Body_Part_ID
    WHERE Incident_Logged BETWEEN @StartDate and @EndDate
    AND Incident_Location_ID IN (@Location)
    ORDER BY Incident_Logged DESC
    

    完成此操作后,将值更改为新列的总和。一旦你这样做了,你的颜色应该对齐。

    来源:https://social.msdn.microsoft.com/Forums/sqlserver/en-US/0dc8aad4-b846-476d-a429-f8fc2312c585/ssrs-2008-chart-legend-colours-not-matching-series-colour?forum=sqlreportingservices - 寻找“softworks phil smith”的答案。

    【讨论】:

      猜你喜欢
      • 2015-05-03
      • 1970-01-01
      • 1970-01-01
      • 2015-12-27
      • 1970-01-01
      • 2017-11-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多