Current filter:
                                You should refresh the page.
                                Support Center
                                0

                                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.


                                You must  log in  or  register  to leave comments
                                Show Implementation Details
                                Select file
                                • MainWindow.xaml
                                Select language
                                • C#
                                • VB.NET
                                Select version
                                • v2010 vol 2.3 - v2014 vol 1.6
                                • v2010 vol 1.5 - v2010 vol 1.12

                                If you need additional product information, write to us at info@devexpress.com 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, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

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