SSRS - 具有 3 个值的条形图 -(一个条应突出显示 2 个值,其余一个在其他条上)

SSRS - Barchart with 3 values - (One bar should highlight 2 values and remaining one on other bar)

我正在尝试制作一个条形图来表示员工的记录时间。可以通过 SSRS 吗??

这是一个示例数据库结构和值,我希望 X 轴和 Y 轴中的“名称”可以是小时数。

一种解决方法是在您的查询中创建交叉联接,以便为堆叠条形图创建虚拟分组。

我的示例数据集:

SELECT 
    name,
    CASE WHEN chartgroup = 1 THEN estimated END AS estimated,
    CASE WHEN chartgroup = 2 THEN actual END AS actual,
    CASE WHEN chartgroup = 1 THEN diff END AS diff,
    chartgroup

FROM (
    select 'alan' as name, 120 as 'estimated', 138 as 'actual',  50 as diff 
    union all
    select 'elsa' as name, 130 as 'estimated', 162 as 'actual',  38 as diff 
) d
CROSS JOIN
(
    SELECT 1 AS chartgroup
    UNION ALL
    SELECT 2 
) c

创建图表以按名称和虚拟组分组,如下图所示

您的结果将如下图所示