Back to Devexpress

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

windowsforms-5858-controls-and-libraries-chart-control-examples-creating-charts-data-representation-how-to-show-currency-values-in-the-legend-of-a-pie-chart.md

latest2.1 KB
Original Source

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

  • Jan 23, 2019
  • 2 minutes to read

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.

  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:

  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.

See Also

Legends

Pattern Editor

How to: Change the Display Format for Series Labels of a Pie Chart