We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Exporting legend and annotations

Hi,

I've followed the documentation's example for exporting/saving a chart to an image, however, I noticed that the legend and some annotations have not been rendered (both snap-shots of WPF and exported image are attached). Is there any way around this? Both elements are really important for my application.

Thanks in advance.

Regards,
Maurizio





Attachment: Desktop_93bffbb1.rar

7 Replies

SA Santhiya Arulsamy Syncfusion Team January 17, 2017 11:50 AM UTC

Hi Maurizio,

Thanks for contacting Syncfusion support.

We are unable to reproduce your reported problem. Can you please check with the sample in the following location? If still you face the problem, please revert us by modifying the sample based on your application along with replication procedure. This would be helpful for us to provide a proper solution.

Sample:ExportSfChart


Thanks,
Santhiya A


MT Maurizio Taddei January 17, 2017 12:02 PM UTC

Hi Santhiya,

Please find attached my sample solution. As you can see, when you save/export the chart, the legend and the text annotations to the right are cropped out or partially cropped out.

Regards,
Maurizio



Attachment: Testing_WFP_Charts_b3c6609d.rar


MT Maurizio Taddei January 17, 2017 04:12 PM UTC

Hi,

I've just noticed that the chart image,which is exported, is cropped differently based on the window size (i.e. if I resize the window). Could the problem have something to do with the container?

Regards,
Maurizio


MT Maurizio Taddei January 17, 2017 04:21 PM UTC

Hi,

I've finally narrowed down the cause: the issue only occurs when I set the Width and Height of the chart. When the latter are not set, then the image is fine.

I suppose I could set the width and height of the Grid cell instead.

Regards,
Maurizio


DA Devi Aruna Maharasi Murugan Syncfusion Team January 18, 2017 11:08 AM UTC

Hi Maurizio, 
  
Thanks for your update. 
  
Since SfChart exporting is implemented by using RenderTargetBitmap. This will render the visual object based on coordinate of its parent object. To avoid the cropping of image while setting the Height and Width for chart, we need to place the chart in an additional layer such as Grid and we need to set the Height and Width property for that container (Grid) instead of chart. 
  
We have modified the provided sample based on your requirement and it can be downloaded from below link, 
  
Regards, 
Devi 
 





MT Maurizio Taddei January 18, 2017 11:17 AM UTC

Ok, understood. Thanks!

Regards,
Maurizio


DA Devi Aruna Maharasi Murugan Syncfusion Team January 19, 2017 03:50 AM UTC

Hi Maurizio, 
  
Thanks for your update. 
  
We glad that your problem has been resolved. Please let us know, if you need any further assistance on this. 
  
Regards, 
Devi 


Loader.
Live Chat Icon For mobile
Up arrow icon