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?
I have opened a private case for you so that I can link it to an active internal development issue. This way you will be notified automatically when the dev issue is updated. The case number is CAS-151756-N9J7B9. You will see it located here: https://es.infragistics.com/my-account/support-activity
Let me know if you have any questions regarding this matter.
"what values are you passing in and what do they get mapped to in regards to the point to plot? "
you can check in the source code how each of the plots was generated (with the exception of the top-right one, which was photshopped to display a possible alternative). But long story short, the algorithm I had in mind is to detect infinites and replace them for a value which would be around 2 x max value being displayed (I'd avoid using something like double.MaxValue or similarly large values to avoid the overshoot the interpolation algorithm uses, and also would preffer something larger than the max drawing area to avoid confusion with actual values that may be close to the top), so for this particular case in the picture, for a value of positive infinity, it gets mapped instead to +20, given the top value of the Y range is 10. Overall, my expectation (asides from the samples) would be to find a somewhat intuitive / clear way to denote the graph goes way off values without messing the rest of the graph.
"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? "
The reason I'm using composite charts is because I need to be able to plot at least 4 simultaneous overlapped scatter charts, each with a different Y axis (which I need to display all of them for scale purposes, parallel to each other), all using the same X axis. With a regular scatterchart I wasn't able to plot more than 2 different Y axes.
Thanks,