I have simple GUI a program where the real time plot(using WinForms
chart) crashes due to non-double values like infinity or NaN
.
So I want to filter values such as infinity,NaN
or ect
. And only plot valid double values. It can also be any other non-double type.
I try the following:
if(!double.IsInfinity(value)){
chart1.Series["mySerie"].Points.AddY(value);
}
But the above only checks if the value is not infinity not other non-double possibilities.
In my case Double. TryParse
also would not work because it is used to check whether text is a double.
So in my case I receive data from a device normally a double. But sometimes it outputs non-double values and is there a quick fix for it?