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

Exported image gets cropped

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

1 Reply

MK Muneesh Kumar G Syncfusion Team 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.
 


Loader.
Live Chat Icon For mobile
Up arrow icon