Event, when chart is defenetly renderd

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
frank
Posts: 51
Joined: Tue Mar 25, 2014 9:04 am

Event, when chart is defenetly renderd

Post by frank » Mon Oct 20, 2014 12:08 pm

Hi,

is there an Event I can hook into, when the chart is defenetly rendered on the screen? I'm loading external data to the chart and want to render the UIElement afterwards (like a Screenshot from a specific part of the program-window).

I tried to use chart.AfterRendering, but then I always get an empty chart, because the points are not fully rendered. My series use CustomLinePointColoringAndShaping, which delays rendering a bit.

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

Re: Event, when chart is defenetly renderd

Post by ArctionPasi » Wed Oct 22, 2014 8:49 am

AfterRendering is fired when LightningChart contents has been updated. By browsing the internet, I found it is a general problem in WPF framework that there's no telling when the WPF UI actually updates and when it's safe to make a capture from continuously updating WPF window.

In AfterRendering event handler it's possible to store the chart contents to a file, simply by calling chart.SaveToFile("filename.png") method.

You may want to experiment BeforeRendering event handler as well, and try if your code makes a proper capture there.
LightningChart Support Team, PT

frank
Posts: 51
Joined: Tue Mar 25, 2014 9:04 am

Re: Event, when chart is defenetly renderd

Post by frank » Wed Oct 22, 2014 10:14 am

Hi Pasi,

thanks for your effort. That's what I also found so I was hoping LC would provide perhaps an Event where I could bypass this problem. I'll try another solution, because I try to save a WPF-Grid containing multiple LightningCharts.

Post Reply