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 for large number of series decreases the size of actual chart

I have a chart with lots of series. Unfortunately, the series legend reduces the chart height to the point it unuseable.

See below.

Series legend overide chart height

What can I do to fix that? Can I fixed the chart height and allow dynamic height for legends?

Thanks.

3 Replies

DA Devi Aruna Maharasi Murugan Syncfusion Team December 21, 2016 11:01 AM UTC

Hi Syaiful, 
  
Thanks for contacting Syncfusion Support. 
  
We have analyzed the reported problem and it can be avoided by applying Template for chart legend and chart legend panel as like the below code snippet, 
          <chart:SfChart.Legend> 
                <chart:ChartLegend > 
                     <chart:ChartLegend.ItemsPanel> 
                        <ItemsPanelTemplate> 
                            <ItemsWrapGrid   Orientation="Horizontal"/> 
                        </ItemsPanelTemplate> 
                     </chart:ChartLegend.ItemsPanel> 
                    <chart:ChartLegend.Template> 
                        <ControlTemplate> 
                            <ScrollViewer Margin="10" Height="100"             
                                          HorizontalScrollMode="Enabled" 
                                          HorizontalScrollBarVisibility="Visible"  
                                          VerticalScrollBarVisibility="Visible"   
                                          VerticalScrollMode="Enabled"> 
                                <ItemsPresenter/> 
                            </ScrollViewer> 
                        </ControlTemplate> 
                    </chart:ChartLegend.Template> 
                </chart:ChartLegend> 
          </chart:SfChart.Legend> 
  
We have prepared a demo sample based on your requirement and it can be downloaded from below link, 
  
Sample: LegendUWP 
  
Please refer our UG documentation link to know more about the chart legend template, 
  
Regards, 
Devi 
  





SN Syaiful Nizam Yahya December 21, 2016 11:21 AM UTC

Thank you so much! That really helps!

+1


DA Devi Aruna Maharasi Murugan Syncfusion Team December 22, 2016 03:58 AM UTC

Hi Syaiful, 
  
Thanks for your update. 
  
Please let us know, if you need any further assistance on this. 
  
Regards, 
Devi 


Loader.
Up arrow icon