Chart keeps resizing axis - hangs UI thread

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
NielsUll
Posts: 19
Joined: Thu Jan 19, 2017 8:23 am

Chart keeps resizing axis - hangs UI thread

Post by NielsUll » Fri Mar 03, 2017 1:11 pm

Hi!

Using 7.2.5.1 on .net 4.6.2, windows 7, 64 bit.

We are using an XY plot. For certain sizes, it gets stuck in a loop continuosly updating the axis. This also freezes the UI thread. I have attached a small video clip showing it. It only happens for some plot sizes - most of the time it works fine, but occasionally you resize the window and get stuck.

Breaking in visual studio gives a stack trace like this

Code: Select all

 	Arction.Wpf.SemibindableCharting.LightningChartUltimate.dll!Arction.Wpf.SemibindableCharting.SeriesXY.FreeformPointLineSeries.ZYB(double A, double B, int C, int F, int G, int H, double I, int J, double K, out int[] L)	Unknown
 	Arction.Wpf.SemibindableCharting.LightningChartUltimate.dll!Arction.Wpf.SemibindableCharting.SeriesXY.PointLineSeriesBase.ZYB(double A, double B, int C, int F, int G, int H, double I, int J, double K)	Unknown
 	Arction.Wpf.SemibindableCharting.LightningChartUltimate.dll!Arction.Wpf.SemibindableCharting.LightningChartUltimate.UWC(Arction.Wpf.SemibindableCharting.SeriesXY.PointLineSeriesBase A, int B, double C, double F, double G, int H)	Unknown
 	Arction.Wpf.SemibindableCharting.LightningChartUltimate.dll!Arction.Wpf.SemibindableCharting.LightningChartUltimate.NWC(System.Collections.Generic.List<Arction.Wpf.SemibindableCharting.SeriesXY.PointLineSeriesBase> A, int B, double C, int F, double G, double H)	Unknown
 	Arction.Wpf.SemibindableCharting.LightningChartUltimate.dll!Arction.Wpf.SemibindableCharting.LightningChartUltimate.NWC(Arction.Wpf.SemibindableCharting.Axes.AxisX A, double B, double C, int F, double G, int H)	Unknown
 	Arction.Wpf.SemibindableCharting.LightningChartUltimate.dll!Arction.Wpf.SemibindableCharting.LightningChartUltimate.YTC()	Unknown
 	Arction.Wpf.SemibindableCharting.LightningChartUltimate.dll!Arction.Wpf.SemibindableCharting.LightningChartUltimate.DNC()	Unknown
 	Arction.Wpf.SemibindableCharting.LightningChartUltimate.dll!Arction.Wpf.SemibindableCharting.LightningChartUltimate.BNC()	Unknown
 	Arction.Wpf.SemibindableCharting.LightningChartUltimate.dll!Arction.Wpf.SemibindableCharting.LightningChartUltimate.OnRender(System.Windows.Media.DrawingContext drawingContext)	Unknown
>	PresentationCore.dll!System.Windows.UIElement.Arrange(System.Windows.Rect finalRect) Line 945	C#
 	PresentationCore.dll!System.Windows.ContextLayoutManager.UpdateLayout() Line 353	C#
 	PresentationCore.dll!System.Windows.ContextLayoutManager.UpdateLayoutCallback(object arg) Line 589	C#
 	PresentationCore.dll!System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork() Line 1562	C#
 	PresentationCore.dll!System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() Line 1949	C#
 	PresentationCore.dll!System.Windows.Media.MediaContext.RenderMessageHandlerCore(object resizedCompositionTarget) Line 1826	C#


And here's another:

Code: Select all

 	Arction.RenderingEngine11.dll!Arction.RenderingEngine11.RenderingEngine11.JD(Arction.RenderingDefinitions.PointFloat[] A, bool B, float C, Arction.RenderingDefinitions.LinePattern D, int E, Arction.RenderingDefinitions.LineAntialias F, int G, Arction.RenderingDefinitions.LineJointMitering H, bool I, bool J, int[] K)	Unknown
 	Arction.RenderingEngine11.dll!Arction.RenderingEngine11.RenderingEngine11.MakeLineDrawData(ref Arction.RenderingEngine.DrawData ddRef, Arction.RenderingDefinitions.PointFloat[] points, bool separateLines, float width, Arction.RenderingDefinitions.LinePattern linePattern, int patternScale, Arction.RenderingDefinitions.LineAntialias aa, int lineColor, Arction.RenderingDefinitions.LineJointMitering lineJointMetering, bool allowEndJoint, bool forceBeginJoint)	Unknown
 	Arction.RenderingEngine11.dll!Arction.RenderingEngine11.RenderingEngine11.MakeLineDrawData(Arction.RenderingDefinitions.PointFloat[] points, bool separateLines, float width, Arction.RenderingDefinitions.LinePattern linePattern, int patternScale, Arction.RenderingDefinitions.LineAntialias aa, int lineColor, Arction.RenderingDefinitions.LineJointMitering lineJointMitering, bool allowEndJoint, bool forceBeginJoint, int[] colors, ref Arction.RenderingEngine.DrawData drawData)	Unknown
 	Arction.Wpf.SemibindableCharting.LightningChartUltimate.dll!Arction.Wpf.SemibindableCharting.LightningChartUltimate.UWC(Arction.Wpf.SemibindableCharting.SeriesXY.PointLineSeriesBase A, int B, double C, double F, double G, int H)	Unknown
 	Arction.Wpf.SemibindableCharting.LightningChartUltimate.dll!Arction.Wpf.SemibindableCharting.LightningChartUltimate.NWC(System.Collections.Generic.List<Arction.Wpf.SemibindableCharting.SeriesXY.PointLineSeriesBase> A, int B, double C, int F, double G, double H)	Unknown
 	Arction.Wpf.SemibindableCharting.LightningChartUltimate.dll!Arction.Wpf.SemibindableCharting.LightningChartUltimate.NWC(Arction.Wpf.SemibindableCharting.Axes.AxisX A, double B, double C, int F, double G, int H)	Unknown
 	Arction.Wpf.SemibindableCharting.LightningChartUltimate.dll!Arction.Wpf.SemibindableCharting.LightningChartUltimate.YTC()	Unknown
 	Arction.Wpf.SemibindableCharting.LightningChartUltimate.dll!Arction.Wpf.SemibindableCharting.LightningChartUltimate.DNC()	Unknown
 	Arction.Wpf.SemibindableCharting.LightningChartUltimate.dll!Arction.Wpf.SemibindableCharting.LightningChartUltimate.BNC()	Unknown
 	Arction.Wpf.SemibindableCharting.LightningChartUltimate.dll!Arction.Wpf.SemibindableCharting.LightningChartUltimate.OnRender(System.Windows.Media.DrawingContext drawingContext)	Unknown
>	PresentationCore.dll!System.Windows.UIElement.Arrange(System.Windows.Rect finalRect) Line 945	C#
 	PresentationCore.dll!System.Windows.ContextLayoutManager.UpdateLayout() Line 353	C#
 	PresentationCore.dll!System.Windows.ContextLayoutManager.UpdateLayoutCallback(object arg) Line 589	C#
 	PresentationCore.dll!System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork() Line 1562	C#
 	PresentationCore.dll!System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() Line 1949	C#
 	PresentationCore.dll!System.Windows.Media.MediaContext.RenderMessageHandlerCore(object resizedCompositionTarget) Line 1826	C#
 	PresentationCore.dll!System.Windows.Media.MediaContext.RenderMessageHandler(object resizedCompositionTarget) Line 1721	C#
 	WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) Line 104	C#
 	WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler) Line 37	C#
 	WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl() Line 583	C#

I realize there is not much to work with here, but any suggestions would be welcome. Or tell me which extra info you need?
Attachments
XyOrbitControlView.zip
tha xaml file for the view including the plot
(2.94 KiB) Downloaded 520 times
resizing.zip
mp4 Video of resizing chart - zipped to avoid being blocked
(71.16 KiB) Downloaded 531 times

ArctionKestutis
Posts: 555
Joined: Mon Mar 14, 2016 9:22 am

Re: Chart keeps resizing axis - hangs UI thread

Post by ArctionKestutis » Fri Mar 03, 2017 3:15 pm

Hi,

If you see freezing only for particular size, when it a bit mysterious. The stack-traces you pasted just point that ongoing process of DrawData creation. However, currently I have no clue why it would take longer for certain Chart size (which is not even very big). If I understood correctly, you don't get any exception?
It always help full, if we can get test project to test and replicate it here. If you can, please send whole project to Arction's support account. Or point to our Demo examples, where we can reproduce issue.
Meanwhile, I could only suggest usual things:
* disable series.MouseInteraction;
* subscribe for _chart.ChartError event, check the output;
* change RenderingEngine with _chart.RenderOptions.DeviceType
* ensure that you making multiple properties change between BeginUpdate() and EndUpdate().

All the best,
Kestutis

NielsUll
Posts: 19
Joined: Thu Jan 19, 2017 8:23 am

Re: Chart keeps resizing axis - hangs UI thread

Post by NielsUll » Mon Mar 06, 2017 7:34 am

I will try to get a workable copy to you - I just have to get it cleared with the customer. We don't get any exceptions :-(

I will try subscribing the ChartError and adjusting the devicetype.
Mouse interaction is already disabled.
I am a bit uncertain on how to use BeginUpdate/EndUpdate with MVVM and bound properties from the view model? The continous resizing happens with no user interaction and no background processing (at least in our application code).

Regards, Niels

NielsUll
Posts: 19
Joined: Thu Jan 19, 2017 8:23 am

Re: Chart keeps resizing axis - hangs UI thread

Post by NielsUll » Mon Mar 06, 2017 12:38 pm

Solved!


Switching between rendering engine 9 and 11 didn't change anything. And the ChartError event is not raised.

However, I finally noticed that we had set en event handlder on the xAxis.RangeChanged event. And the event handle would always put a new image in the CircleAnnotation.Fill.Bitmap.
And this apparently caused the xAxis to resize again...

ArctionKestutis
Posts: 555
Joined: Mon Mar 14, 2016 9:22 am

Re: Chart keeps resizing axis - hangs UI thread

Post by ArctionKestutis » Mon Mar 06, 2017 1:10 pm

Great! :D

Post Reply