Page 1 of 1

Chart stucks when adding infinite values

Posted: Wed Oct 09, 2013 7:42 am
by djl
Hi,

I was wondering why my application with lighning chart gets stuck sometimes when adding new values to a series. :?:

Then I found out that Apllication freezes in function LightningChartUltimate.EndUpdate without any exception.
Reason is that I added some infinite double values (e.g. double.PositiveInfinity) calculated by function Math.log10.

Freeze only occurs when calling function LightningChartUltimate.ViewXY.FitView() before!

This is a sample code that crashes:

Code: Select all

            SeriesPoint[] sp = new SeriesPoint[2];

            //Point 1
            sp[0].X = 0;
            sp[0].Y = 1;

            //Point 2
            sp[1].X = 2;
            sp[1].Y = double.PositiveInfinity;              //This values crashes FITView
         
            lightningChartUltimate1.BeginUpdate();
            lightningChartUltimate1.ViewXY.PointLineSeries[0].Clear();
            lightningChartUltimate1.ViewXY.PointLineSeries[0].Points = sp;
            lightningChartUltimate1.ViewXY.FitView();       //  No problem if I uncomment this line
            lightningChartUltimate1.EndUpdate();            //  <---  Application gets stuck here 
Now I make sure not to add infinte values, but I think this could be done also in function FitView! ;)

Regards
Dirk

Re: Chart stucks when adding infinite values

Posted: Thu Oct 10, 2013 7:09 am
by ArctionPasi
Don't feed any infinite values for the chart. Infinite values go to GPU and it interpolates pixels billions of pixels and it appears as a freeze or as very long delay.