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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Exporting legend and annotations

Thread ID:

Created:

Updated:

Platform:

Replies:

128349 Jan 16,2017 04:07 PM UTC Jan 19,2017 03:50 AM UTC WPF 7
loading
Tags: SfChart
Maurizio Taddei
Asked On January 16, 2017 04:07 PM UTC

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

Santhiya Arulsamy [Syncfusion]
Replied On 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

Maurizio Taddei
Replied On 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

Maurizio Taddei
Replied On 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

Maurizio Taddei
Replied On 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

Devi Aruna Maharasi Murugan [Syncfusion]
Replied On 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 
 




Maurizio Taddei
Replied On January 18, 2017 11:17 AM UTC

Ok, understood. Thanks!

Regards,
Maurizio

Devi Aruna Maharasi Murugan [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;