[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Collapse]Chart Control
   [Expand]Getting Started
   [Expand]Charting Basics
   [Expand]Series Views
   [Expand]Chart Elements
   [Expand]Providing Data
   [Expand]Data Representation
   [Expand]Appearance Customization
   [Expand]End-User Features
   [Expand]Design-Time Features
   [Expand]Visual Elements
    [Collapse]Creating Charts
     [Expand]Providing Data
     [Collapse]Data Representation
       How to: Change the Display Format for Series Labels of a Pie Chart
       How to: Change the Display Format for Axis Labels
       How to: Change the Display Format for Axis Labels (Runtime Sample)
       How to: Show Currency Values in the Legend of a Pie Chart
       How to: Filter Data
       How to: Show N Top Points as a Single Section in a Pie Chart
       How to: Use Automatic Date-Time Scale Modes of an Axis
       How to: Obtain Values Calculated for Automatic Axis Date-Time Scale Modes
       How to: Create a Custom Summary Function
       How to: Exclude Weekends and Holidays from the Axis Scale
       How to: Specify the Appearance of the Pie Chart Using Its Pattern at Runtime
       How to: Display Qualitative Scale Values Sorted in a Custom Sort Order
       How to: Use Custom Measure Units in an Automatic Date-Time Scale Mode
       How to: Use Custom Measure Units in an Automatic Numeric Scale Mode
     [Expand]Appearance Customization
     [Expand]Series Views
    [Expand]Chart Elements
    [Expand]End-User Interaction
    [Expand]Producing Output
   [Expand]Additional Resources
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How to: Show Currency Values in the Legend of a Pie Chart

The following tutorial demonstrates how to change the default percentage format of point values in the legend to currency and show both argument and values using a Pie Chart as an example.

To display both point arguments and values, and show values as currency in the legend, do the following.

  1. Select the series in the chart's Diagram, and locate the SeriesBase.LegendTextPattern property in the Properties window.

    You can assign a pattern to the SeriesBase.LegendTextPattern property either doing it directly, using the Chart wizard (this method is not considered in the example), or via a Pattern Editor.

    This editor simplifies text customization of legend items.


    The customization of legend items works when the SeriesViewColorEachSupportBase.ColorEach mode is enabled (the ColorEach is always enabled, by default, for Pie, Doughnut and Nested Doughnut charts).

  2. To invoke the Pattern Editor, click the ellipsis button of the SeriesBase.LegendTextPattern property.
  3. Add the Argument and Value placeholders to the 'Pattern:' column. To do this, double click the corresponding items in the 'Placeholders:' column, sequentially.

  4. To apply the currency format to point values in the legend:

    • select Currency from the 'Format:' drop-down list and click the second format.

      This adds the format specifier to the '{V}' pattern in the 'Pattern:' editor column.


      The preliminary result of applying this format is shown in the preview at the bottom of the 'Pattern:' column.

    • click OK to close the editor.

    Finally, let's add a colon separator between Argument and Value placeholders in our pattern. The next step shows how to do this directly in the Properties window.

  5. Locate the SeriesBase.LegendTextPattern property in the Properties window.

  6. Change the applied '{A}{V:$0}' pattern string to '{A}:{V:$0}' .

The result is shown in the following image.

Expanded See Also

Is this topic helpful?​​​​​​​