Chart stucks when adding infinite values

Found a possible bug in LightningChart? Report it here.

Moderator: Queue Moderators

Post Reply
djl
Posts: 8
Joined: Tue Apr 30, 2013 11:47 am

Chart stucks when adding infinite values

Post by djl » Wed Oct 09, 2013 7:42 am

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

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Chart stucks when adding infinite values

Post by ArctionPasi » Thu Oct 10, 2013 7:09 am

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.
LightningChart Support Team, PT

Post Reply