CopyToClipboard(Emf, ...)

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
jcso
Posts: 4
Joined: Wed Apr 26, 2017 2:50 pm

CopyToClipboard(Emf, ...)

Post by jcso » Mon Sep 11, 2023 8:09 am

Hi
When we call CopyToClipboard as Emf on a chart that contains a curve with a range of double.NaN values, the curve is not visible at all after paste it into e.g. word.

Here how it looks in the application. There is a section where we have only double.NaN values on the x-Axis: See orange curve going up at around 1050nm and down again at around 1150nm.
WpfApplication.png
WpfApplication.png (73.1 KiB) Viewed 8147 times
When we CopyToClipboard with EMF and paste it to word, the orange curve is completely gone:
CopyToClipboard_EMF.png
CopyToClipboard_EMF.png (24.18 KiB) Viewed 8147 times
When we CopyToClipboard with BMP and paste it to word, we can see the orange curve:
CopyToClipboard_BMP.png
CopyToClipboard_BMP.png (92.51 KiB) Viewed 8147 times
We like to use EMF as it produces a vector image. But we need to get this orange curve!
Are there settings to control this somehow?

We use the LightningChart 10.4.1.1 NuGet package. Is this behavior changed in a newer version?

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

Re: CopyToClipboard(Emf, ...)

Post by ArctionKestutis » Mon Sep 11, 2023 10:40 am

It is a bit unusual to see that you want to render NAN values like this (vertical line going to infinity). Usually it is not a good idea as .NET is not handles NAN value very well. Therefore, you may end up with overflow- or other type of exceptions. NAN handling is also very much depend on graphic drivers.

The 'safe' approach is to enable Series.DataBreaking.Enabled property (see User Manual chapter 6.29 DataBreaking by NaN or other value). This would allow LightningChart to skip NAN (or other 'breaking' value) from rendering. Even more, vector format image export (like EMF or SVG) will work without issues.

Note, if you subscribing to _Chart.ChartMessage events, then you should see Information severity message about GDI engine issue. In particular overflow-exception due to points being very far away. It comes with zoom-out suggestion. In other words, if you want NAN values to be rendered as vertical line to infinity (consistently), then it is better to replace with some real, but very big value.

P.S. LightningChart could handle NAN values internally (through DataBreaking feature). However, this come at the cost of performance. Therefore, user should carefully consider its usage in streaming/realtime applications (if millions or billions of points need to be rendered).

Hope this helps.

jcso
Posts: 4
Joined: Wed Apr 26, 2017 2:50 pm

Re: CopyToClipboard(Emf, ...)

Post by jcso » Mon Sep 11, 2023 10:50 am

Thanks for your answer.
In fact we don't like to show double.NaN values - we would prefer to hide them.
So your answer fits perfectly to our requirement. :)
I'll try out your suggestion asap.

Post Reply