I am creating a simple 3-point line chart in C#, which displays perfectly, unless I set one of the data values to double.PositiveInfinity. Then the chart hangs indefinitely trying to plot, using maximum CPU. Is this a known issue? Yes, it is stupid to deliberatly pass infinity to the chart, but it could happen in real life.
Thanks, Kevin
Hi Kevin,
The issues with Double.NaN and Double.Infinity are fixed in our latest service pack. Please download the updated product from our website.
Best Regards,Milen
Thanks. The service pack has fixed the hanging issue with infinities and oddly drawn charts with double.NaN.
Double.NaN values are treated as missing points.
When there is an infinity in any data series plotted on one of the y-axes, then nothing whatsoever is plotted on the axis. So you could have one series with a single infinity data point, and ten others which are OK, but none are plotted. I think it would be useful to have an option of "Treat infinities as missing points" so the rest of the data could be plotted.
Are there any plans to treat infinities the same as NaN? It is rather disappointing that a single infinity in one series, prevents all series of the same type being plotted.
Yes we're going to add an option to treat infinity as missing values. Should be ready in the next SP of the component.Best regards,Bob
Yes it present in the current download – you just have to set the TreatInfinityAsEmpty to the respective value series – for example:
NChart chart = nChartControl1.Charts[0];NBarSeries bar = new NBarSeries();bar.Values.Add(10);bar.Values.Add(Double.PositiveInfinity);bar.Values.Add(Double.NegativeInfinity);bar.Values.Add(40);bar.Values.TreatInfinityAsEmpty = true;chart.Series.Add(bar);
Best Regards,Nevron Support Team