Articles in this section
Category / Section

How to add multiple legend items in scroll viewer in UWP Chart?

1 min read

This article describes how to show ScrollBar when chart having more number of legends in UWP Chart.

The legend items are used to display the series label values. When a greater number of series are added to the chart, some of the legend items are hidden from the view. The chart allows you to place the chart legend inside the Scrollbar to view all the legend items by customizing the ControlTemplate of the legend.

To add multiple legend items inside any container such as scroll viewer, define the Template for the legends as illustrated in the following code example.

 

<chart:SfChart.Legend>
 <chart:ChartLegend Height="50" DockPosition="Top">
  <chart:ChartLegend.Template>
  <!--Customize the Legend Template to show scroll bar-->
   <ControlTemplate>
    <ScrollViewer Margin="1" VerticalScrollBarVisibility="Auto" 
    HorizontalScrollBarVisibility="Auto">
     <ItemsPresenter></ItemsPresenter>
    </ScrollViewer>
   </ControlTemplate>
  </chart:ChartLegend.Template>
 </chart:ChartLegend>
</chart:SfChart.Legend>

 

 

Multiple Legends with scroll bar

 

 

See also

How to customize the legends position

How to customize the icons of the legends in SfChart

How to format the legend text

 

 

Conclusion

I hope you enjoyed learning about how to add multiple legend items in scroll viewer in UWP Chart.

You can refer to our UWP Chart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied