Hello,
I'm currently trying to draw a chart (scatterchart, but with 'composite' mode), were the input data may contain infinite values on the Y axis (Y axis has a custom range set; not autocalculated). I have the 'connect with lines' options set to ON. The problem is, the charts are not representing the infinity as I'd expect.
What I'd expect:
- [1] Having the line go straight up (where it's noticeable that it's outside of range), regardless of the current Y axis range
- [2] Having a gap where the infinite value is located (i.e., do not plot), but continue with the line after the infinite
What I'm currently able to get
- [a] Without any special code, when I plot an infinite value, the 'connect with lines' option gets disable, and I only see datapoints up until the infinite point (and nothing after)
- [b] If I add code to 'turn off' the infinite point itself with the "empty' boolean property of XYDatapoint, it looks like there was no infinite there to begin with (which would be misrepresenting the data).
- [c] I could scan the series for infinite values, and replace them with something outside of the Y-range value, which would achieve something similar to what I'm looking for. However, this would take some refactoring outside the graph code, which I'd rather avoid.
Graph images : Check attachment
source code : https://pastee.org/73y73
Thanks in advanced for any reply,
- Nicolas.
Ammend:
On the chart labels, the top left should read "1 or C", and the top right should read just "2".
Please also take into account modifying /testing the source code, the line
string graphToReproduce = "c";
accordingly.
And finally, I forgot to actually ask, Is there a quick setting or configuration I could use to obtain the desired effect?
Thanks again,
Hi Nicolas,
In response to [a] I'm guessing the calculated screen point to plot ends up outside the drawing canvas and an exception is occurring and therefore nothing else draws. I'm currently looking a bug that describes similar behavior and deciding if we should continue to rethrow the exception or instead limit the point to the bounds of the drawing canvas... which btw means the point is somewhere around MIN_GDIPLUS = -1,073,741,760 and MAX_GDIPLUS = 1,073,741,951 (quite large plot points ;)) what values are you passing in and what do they get mapped to in regards to the point to plot? Perhaps the double.PositiveInfinity and double.NegativeInfinity aren't being accounted for accurately and we should just map those to the min/max of the drawing surface? Is that what you would expect? I'm a bit worried about how the "unmap" of the plot point will then be able to give you back the value represented at that point if we start to limit things in this manner. Give me a bit to look at this application and see what we can do here...
Also out of curiosity, why are you using a composite chart here and not just a scatter chart? What else is being added to the chart?