好的,所以我解决了这个问题。
首先,为了让线条连接起来,您需要为系列设置EmptyPoint 颜色。
- 在图表中选择您的系列
- 在属性选项卡(不是对话框)中,深入到 EmptyPoint 属性并将颜色设置为黑色
这会让他们加入 - 耶!但是线的一部分是彩色的,另一部分是黑色的,对吧?这有点傻,特别是考虑到如果您在 EmptyPoint 上将颜色保留为 Automatic,它将是透明的。
那么,我们需要让系列和 EmptyPoint 的颜色同步。
使用来自here 的代码。我在报告的代码中添加了一些代码。
1)。右键单击报告上的空白区域并选择“报告属性”
2)。在代码选项卡中,粘贴以下内容:
Private colorPalette As String() = {"#418CF0", "#FCB441", "#E0400A", "#05642E", "#1A3B69", "#BFBFBF", "#E0400A", "#FCB441", "DarkBlue", "Tomato", "Orange", "CornflowerBlue", "Gold", "Red", "Green", "LightBlue", "Lime", "Maroon", "LightSteelBlue", "Tan", "Silver"}
Private count As Integer = 0
Private mapping As New System.Collections.Hashtable()
Public Function GetColor(ByVal groupingValue As String) As String
If mapping.ContainsKey(groupingValue) Then
Return mapping(groupingValue)
End If
Dim c As String = colorPalette(count Mod colorPalette.Length)
count = count + 1
mapping.Add(groupingValue, c)
Return c
End Function
那么我们需要在设置系列和EmptyPoint的颜色时调用这个代码。
- 选择您的系列
- 在属性选项卡中粘贴以下内容(将 WhateverTheGroupIsForYourSeries 替换为您的系列组名称):
=Code.GetColor(Fields!*WhateverTheGroupIsForYourSeries*.Value)
- 向下钻取到
EmptyPoint 系列属性的颜色元素
- 粘贴与第二点相同的文本 [e.g.
=Code.GetColor(Fields!*WhateverTheGroupIsForYourSeries*.Value)]
瞧!你完成了!
我不敢相信这是多么不必要的困难:D