Hello,
This question is related to this discussion :
https://www.scichart.com/questions/wpf/export-chart-with-heatmapcolormap
I want to export a chart as XPS and have the HeatmapColorMap on the XPS. I put the HeatmapColorMap inside a CustomAnnotation. I had an issue with the ticks and labels not appearing on the printed XPS so I was advised to use a workaround :
public class SciChartSurfaceEx : SciChartSurface
{
protected override SciChartSurfaceBase CreateCloneOfSurfaceInMemory(Size newSize)
{
// Grab custom annotation that stores HeatmapColormap on a real chart
var originalColormapAnnotation = (CustomAnnotation)this.Annotations.Where(x => x.GetType() == typeof(CustomAnnotation)).FirstOrDefault();
var originalColorMap = originalColormapAnnotation.Content as HeatmapColorMap;
// Perform exporting functionality(serializing\deserializing)
var cloned = (SciChartSurface)base.CreateCloneOfSurfaceInMemory(newSize);
var newWindow = new Window();
newWindow.Content = cloned;
newWindow.Show();
newWindow.Close();
return cloned;
}
}
Opening a new window is a workaround to prevent the HeatmapColorMap from disappearing after exporting, because it disappears otherwise.
This works fine when exporting a PNG at non-default size but it does not work when exporting as XPS. I get the following exception :
System.InvalidOperationException: ‘Specified element is already the logical child of another element. Disconnect it first.’
Why do I have this exception ? Is there any way around it ?
There are quite a few bugs when exporting charts, it would be nice to have them fixed.
Thank you in advance !
- Renaud Danniau asked 2 years ago
-
Hello Renaud, Thanks for your inquiry. Could you please send us a small sample project reproducing this issue for investigation? It can be based on our examples from the Examples suite. Thanks in advance. With best regards, Oleksandr
-
Hello Oleksandr, Thanks for you answer. How should I post the sample projet if the size of ZIP file exceeds 1MB ?
-
Hello Renaud, Yes, it’s acceptable file size. You can also submit a support request here if you don’t wish to post the project publicly: https://support.scichart.com/index.php?/Tickets/Submit With best regards, Oleksandr
- You must login to post comments
Hello Oleksandr,
This works fine, thank you for your response !
- Renaud Danniau answered 2 years ago
- You must login to post comments
In order to export Heatmap and HeatmapColorMap as the same image, HeatmapColorMap should be a child of the SciChartSurface you export.
cookie clicker
- Eric Moliner answered 2 years ago
- You must login to post comments
Hello Renaud,
Thanks for your inquiry. I am sorry for the late reply.
In order to export Heatmap and HeatmapColorMap as the same image, HeatmapColorMap should be a child of the SciChartSurface you export.
Please take a look at the following forums thread for more info:
https://www.scichart.com/questions/wpf/exporting-heatmap-to-png-with-included-heatmapcolormap
Hope this helps,
With best regards,
Oleksandr
- Oleksandr Shvets answered 2 years ago
- You must login to post comments
Please login first to submit.