SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

0
0

Hi,

I’m trying to export my graphs using the XamlRenderSurface and the ExportToXPS extension function.

I can export a BitmapImage from it fine but the xps image only has the Axis lines and a vertical annotation on it. See images for comparison.

Also, it outright crashes in some other graphs I have on Get MinorDelta because of a null reference exception, no additional info is given out by DebugWhySciCharDoesntRender = true. Likewise in this case, I can export to bitmap just fine. I am using custom tick providers.

I should also note that I’m rendering the charts from memory they’re not visually displayed when export them.

Version
4.2.2.9777
Images
  • You must to post comments
0
0

Hi Kewur,

SciChartSurface.ExportToXps(string filePath) internally calls SciChartSurface.ExportToFile(filePath, ExportType.Xps, true).

The signature for ExportToFile is

    /// <summary>
    /// Saves snapshot of current <see cref="SciChartSurfaceBase"/> to file
    /// </summary>
    /// <param name="fileName">The Filename to save to</param>
    /// <param name="exportType">Defines format of file to export</param>
    /// <param name="useXamlRenderSurface">Defines better quality of export output</param>
    public virtual void ExportToFile(string fileName, ExportType exportType, bool useXamlRenderSurface) { } 

If the parameter useXamlRenderSurface is TRUE (it is, from ExportToXps) then SciChart uses the XamlRenderSurface intenrally.

I checked and your license type (SciChart WPF 2D Pro) does not include a license for this feature. The XamlRenderSurface is only available in SciChart WPF 2D Enterprise or SciChart WPF SDK Professional.

Can you try this code instead?

 string fileName;
 sciChartSurface.ExportToFile(filename, ExportType.Xps, false);

If you still experience problems, please submit a support ticket including code to reproduce the issue. We will investigate.

Best regards,
Andrew

  • kewur
    Hi Andrew, I requested an extension to my trial for enterprise to test the xps exports. I tried with the alternative but it produces the same result as before. I will try to make a project reproducing the issue.
  • Andrew
    You can check trial is applied correctly by setting SciChartSurface.RenderSurface = new XamlRenderSurface(). If the chart in your app goes blank, then its not applied.
  • kewur
    Yes it is applied, just tested it.
  • Andrew
    Thanks for checking! Please send some code over, we will investigate asap.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.