我上下寻找,似乎无法找到看似相当简单的问题的答案(我认为)。
我有一个折线图,其中一系列数据中有多个点,但只有一组点连接起来。
有谁知道这是为什么?跟我的数据有关系吗?如果是的话,我正在努力寻找数据中可以解释这种行为的任何关系。
这就是我的意思:

如您所见,红色菱形应该正在连接 - 同样可以是说了蓝色方块和深蓝色三角形。有什么想法吗?
如果我的颜色错误,请道歉 - 我是色盲。
I've looked high and low and can't seem to find an answer to what appears to be quite a straightforward issues (I would think).
I have a line chart where there is data at several points in a series but only only one set of points link up.
Does anyone know why this is? Is it to do with my data? If it is, I am struggling to see any relationships in the data that may explain this behavior.
Here is what I mean:

As you can see, the red diamonds should be connecting - the same could be said about the blue squares and the dark blue triangles. Any thoughts?
Apologies if my colors are wrong - I'm colorblind.
发布评论
评论(4)
好的,所以我解决了这个问题。
首先,为了让线条连接起来,您需要设置系列的
EmptyPoint
颜色。这将使它们加入 - 耶!但线条的一部分是彩色的,另一部分是黑色的,对吗?这有点愚蠢,特别是考虑到如果您将 EmptyPoint 上的颜色保留为“自动”,它将是透明的。
因此,我们需要使系列和 EmptyPoint 的颜色同步。
使用此处中的代码。我在报告的代码中添加了一些代码。
1)。右键单击报告上的空白区域并选择“报告属性”
2)。在代码选项卡中,粘贴以下内容:
然后我们需要在设置系列和
EmptyPoint
的颜色时调用此代码。=Code.GetColor(Fields!*WhateverTheGroupIsForYourSeries*.Value)
EmptyPoint
Series 属性的颜色元素=Code.GetColor(Fields!*WhateverTheGroupIsForYourSeries*.Value)
]瞧!你完成了!
我不敢相信这是多么不必要的困难:D
Okay, so I worked this out.
Firstly, in order to get the lines to join up, you need to set the
EmptyPoint
colour for the series.This will get them joining up - yay! But part of the line is colour and the other part is black, right? That's a bit silly, especially considering if you leave the colour to Automatic on the EmptyPoint that it will be transparent.
So, then we need to get the series and the EmptyPoint's colours in sync.
Using code from here. I added some code to the code of the report.
1). Right click on an empty space on the report and select "Report Properties"
2). In the code tab, paste the following:
Then we need to call this code when setting the colour of the series and of the
EmptyPoint
.=Code.GetColor(Fields!*WhateverTheGroupIsForYourSeries*.Value)
EmptyPoint
Series property=Code.GetColor(Fields!*WhateverTheGroupIsForYourSeries*.Value)
]And voila! You're done!
I can't believe how unnecessarily difficult this is :D
我只是遇到一个问题,它显示标记但不显示线条。我最终通过将表达式包装在 CInt() 中以将其转换为整数来解决它。
I just had a problem where it was showing markers but not the lines. I ended up solving it by wrapping the expression in a CInt() to convert it to an integer.
处理此问题的另一种方法是进行递归选择(如果您有非常大的数据集,请不要这样做,它会降低性能)。所以你可以制作你的数据集:
现在你可以让你的类别组为 rn (它应该按 rn 分组并按 rn 排序),但为其标签选择日期。这仍将在 x 轴上显示日期,但由于您按 rn 分组,因此数据仍将是连续的,并且所有行都将连接。而且你的传说仍然会匹配。
我仍然没有深入研究这对数据点的改变有多大,因为我们使用行号和显示日期进行绘图,但是如果您主要关心可视化行中的趋势而不是关心它们所在的位置在给定的时间点上,它会对你很有帮助。否则,我会保留图表原样,只读取绘图点,它们仍然是有效数据。
Another way to handle this is to do a recursive select (if you have very large data sets don't do this, it kills performance). So you could make your dataset:
Now you can have your category group be rn (it should group by rn and sort by rn) but select date for its label. This will still display the date on your x axis, but since you are grouping by rn the data will still be continuous and all of the lines will connect. Also your legend will still match.
I still haven't looked deeply into how much this shifts the data points since we are plotting with row number and displaying date, but if you are mainly concerned with visualizing trends in the lines and aren't as concerned with where they are at a given point in time in relation to one another, it will serve you just fine. Otherwise I would leave the chart the way it is and just read the plot points, which are still valid data.
解决方案
只需将您的字段!(YourSeriesGroup).系列组中的值放在上面
Fields!(YourCategoryGroup).类别组中的值,您的系列组应同时位于系列组和类别组中(应位于初始类别组之上)。
然后右键单击水平轴并选择水平轴属性。将“轴类型”设置为“标量”,然后单击“确定”。
结果
Solution
Just put your Fields!(YourSeriesGroup).Value in Series Groups to above of
Fields!(YourCategoryGroup).Value in Category Groups, your series group should be in both Series Groups and Category Groups (should be above of your initial category group).
And after that right click horizontal axis and select Horizontal Axis Properties. Set Axis Type to Scalar and click OK.
Result