SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
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.
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
Please login first to submit.