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

Legend Wrap (OverflowMode) on WPF SfCharts

I've noticed that in Xamarin platform you have an option to wrap legends ( https://help.syncfusion.com/xamarin/sfchart/legend#legend-wrap ).
I couldn't find that option on WPF. Is there a way to do the equivalent to OverflowMode="Wrap" in WPF Charts?
Thanks in advance

3 Replies

MK Muneesh Kumar G Syncfusion Team March 11, 2019 06:41 AM UTC

Hi Carlos, 
 
Greetings from Syncfusion.  
 
We have analyzed your and we would like to inform you that when there is more number of legends, the legend exceeds the chart will be cropped, as it arranged horizontally.  
 
To avoid the cropping, we can change the existing arrangement layout (one which arrange each legend items horizontally) using ItemsPanel property as in below code snippet: 
 
Code snippet 
<syncfusion:SfChart x:Name="chart"> 
 
    <syncfusion:SfChart.Resources> 
 
        <ItemsPanelTemplate x:Key="itemPanelTemplate"> 
 
             <WrapPanel/> 
 
        </ItemsPanelTemplate> 
                 
    </syncfusion:SfChart.Resources> 
 
    <syncfusion:SfChart.Legend> 
 
            <syncfusion:ChartLegend ItemsPanel="{StaticResource itemPanelTemplate}"/> 
 
    </syncfusion:SfChart.Legend> 
 
 </syncfusion:SfChart> 
 
Screenshot: 
 
 
 
Hope it helps you.  
   
Thanks, 
Muneesh Kumar G.  
 



CF Carlos Fernando Consigli March 11, 2019 01:27 PM UTC

Excellent, thanks. It worked perfectly.


MK Muneesh Kumar G Syncfusion Team March 12, 2019 03:57 AM UTC

Hi Carlos,  
 
Thanks for the update. 
  
We are glad to know that the given solution works. Please let us know if you need any further assistance. 
 
Thanks, 
Muneesh Kumar G.  
 


Loader.
Live Chat Icon For mobile
Up arrow icon