Profile Picture

Performance degradation while zooming in on dashed lines

Posted By Sandor Davidhazi 9 Years Ago

Performance degradation while zooming in on dashed lines

Author
Message
Sandor Davidhazi
Problem Posted 9 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)

Group: Forum Members
Last Active: 9 Years Ago
Posts: 5, Visits: 24
Hi,

We have encountered a problem where if you zoom in on dashed lines the re-rendering takes longer and longer each time. After a while the chart seems to be frozen.

I have attached a file which is a modified WPF sample file. Just replace the contents of the original sample, start the WPF Example app, go to Chart Gallery / Line / Sampled 2D line and keep zooming in on the dashed line (keep it in the viewport in every zoom level).

The key seems to be the property called NLineSeries.SamplingMode. If it is set to SeriesSamplingMode.Enabled then as you zoom in the dashes get longer and wider. If it is Disabled, then the dashes stay at their original size regardless of the zoom level, but the rendering get longer.

1.) What can be done to keep the performance during zooming regardless of the chosen SeriesSamplingMode value?
2.) In our solution it is set to enabled, but it still behaves as if it was disabled. (The performance problem persists.) Is there any other factor which influences the performance during zooming in on dashed lines which we may not be aware of?

Thanks,
Sandor

Attachments
NSampledLine2DUC.xaml.cs.txt (418 views, 6.00 KB)
Nevron Support
Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 1:54 AM
Posts: 3,054, Visits: 4,009
Hi Sandor,
Most likely this is a GDI+ problem - if you switch the control in window mode where we use hardware accelerated rendering the speed improves a lot and there is no dashing problem:

nChartnChartControl1.Settings.RenderSurface = RenderSurface.Window;
We just tested with 1M data points and continuous zooming and was working OK.


Best Regards,
Nevron Support Team



Sandor Davidhazi
Posted 9 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)

Group: Forum Members
Last Active: 9 Years Ago
Posts: 5, Visits: 24
Hi,

I mistakenly said that we are using the WPF version, but in fact we are using the WinForms version of Charting. 
Thanks for the answer, it fixed the issue in the sample application. Unfortunately it didn't fix the issue in our live application. 

I checked the RenderSurface property's value by attaching with Visual Studio and it really is set to window. I suspected that the problem may be that we are mixing technologies. The live application is WinForms, which contains WPF using ElementHost, and WPF contains the WinForms version of the Nevron Charting component using WindowsFormsHost. (Unfortunate situation, but this is what we are working with. Smile ) So I recreated the mixed stack in the WinForms sample application but the performance issue didn't surface with RenderSurface.window. I looked around the code for some other settings which may be different between the live and the sample application but I haven't found anything suspicious.

I'm at the end of my wits. Do you have any suggestions on how to debug why hardware acceleration is not available, event though I set the right property? I'm also open to downloading third party diagnostic tools.

Thanks,
Sandor

Sandor Davidhazi
Posted 9 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)Forum Newbie (0 reputation)

Group: Forum Members
Last Active: 9 Years Ago
Posts: 5, Visits: 24
I forgot to attach the modified code in the sample application. You need to reference the required WPF assemblies to make it work. (ReSharper should take care of that if you have it.) The changes are all in NMainForm's constructor.


Attachments
NMainForm.cs.txt (348 views, 8.00 KB)


Similar Topics


Reading This Topic