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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to add multiple legend items in scroll viewer?

Platform: WPF |
Control: SfChart |
Published Date: May 13, 2015 |
Last Revised Date: June 27, 2019
Tags: legend, scrollbar


The legend items are used to display the series label values. When more 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. This articles describes how to add multiple legend items inside the scrollbar.


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


<!—Adding ScrollViewer for Legend items-->
<chart:SfChart x:Name="sfchart" Margin="10" >
        <chart:ChartLegend  DockPosition="Top">
                    <ScrollViewer Margin="30" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">

The following screenshot illustrates the output.


Chart legend is placed inside the scrollbar to view all the legend items in WPF

Figure 1: Chart legends in ScrollViewer.

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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