Current filter:
                                You should refresh the page.
                                Support Center

                                This example demonstrates how to calculate a total of values displayed by each legend item, and show this total in the legend. This can be done by utilizing a ControlTemplate with a Grid, containing a LegendItemsControl (for displaying legend items) and a TextBlock (showing the result). The summary is calculated in the chart control's BoundDataChanged event handler, and assigned to the DataContext property of the legend, to provide this value for the TextBlock's text. In the ControlTemplate, the Border's appearance properties (Background, BorderThickness, BorderBrush and Padding) and the LegendItemsControl's properties (ItemTemplate and ItemsSource) are bound to similar properties of the legend. You can customize the legend's layout and appearance as required, using this sample as a starting point.

                                See also:
                                - How to display check boxes for legend items to control the visibility of series;
                                - How to customize chart titles.

                                Show Implementation Details
                                Select file
                                • MainWindow.xaml
                                • MainWindow.xaml.cs
                                Select language
                                • C#
                                • VB.NET
                                Select version
                                • 15.1.3 - 17.2.3
                                • 10.2.3 - 14.2.15
                                • 10.1.5 - 10.1.12

                                If you need additional product information, write to us at or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2017 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners