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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Exported image gets cropped

Thread ID:

Created:

Updated:

Platform:

Replies:

145607 Jul 1,2019 07:18 AM UTC Jul 1,2019 11:17 AM UTC WPF 1
loading
Tags: SfChart
Carlos Fernando Consigli
Asked On July 1, 2019 07:18 AM UTC

I'm trying to export a chart as image, but legends and headers get cropped out.
I'm attaching a rough sample where you can see the "2002" legend gets cropped and also the header of the serie is not visible when exporting to a png.
I saw this post (https://www.syncfusion.com/forums/128349/exporting-legend-and-annotations) but did not fully understand the solution.
What I am missing? I guess there is something wrong with my markup.
Thanks in advance

Attachment: Testing_WFP_Charts_Exporting_62835f42.zip

Muneesh Kumar G [Syncfusion]
Replied On July 1, 2019 11:17 AM UTC

Hi Carlos, 
 
Greetings from Syncfusion.  
 
We have analyzed your query and your sample, and we found that the margin applied for SfChart. You can resolve this problem by setting margin SfChart’s container instead of setting the value to SfChart as per the below code snippet.  
 
Code snippet 
 
<Grid Margin="25,25,25,22" Grid.Row="1"> 
            <chart:SfChart  Header="{Binding Path=ChartTitle}" Name="linechart"  
                    Background="White"   VerticalAlignment="Bottom" AreaBorderThickness="0,1,1,1"> 
 
                .. 
 
                <chart:SfChart.PrimaryAxis> 
                    <chart:CategoryAxis  EdgeLabelsDrawingMode="Fit" 
                                    PlotOffset="10" 
                                    HeaderTemplate="{StaticResource xheadertemplate}"  
                                    /> 
                </chart:SfChart.PrimaryAxis> 
 
                .. 
 
        </Grid> 
 
 
Also, we suggest to set EdgeLabelsDrawingMode as Fit to view edge labels clearly in exported image. We have modified your sample based on above explanation, please find the sample from the following location.  
 
 
Please let us know if you have any other queries.  
 
Thanks,
Muneesh Kumar G.
 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon