Back to Devexpress

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

windowsforms-6063-controls-and-libraries-chart-control-examples-creating-charts-data-representation-how-to-change-the-display-format-for-series-labels-of-a-pie-chart.md

latest2.9 KB
Original Source

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

  • Jul 17, 2019
  • 3 minutes to read

This tutorial demonstrates how to change the display format for Pie chart series labels at design time to show both arguments and values as real values, and not percentages.

To change the display format of series labels, do the following.

  1. Create a simple unbound chart of the PieSeriesView type. Or, for an existing chart, change the view of its series to Pie.

  2. After this step, the Pie chart will appear as follows (with its legend hidden).

  3. By default, Pie series labels display their point values as percentages. To make them display real values, do the following.

  4. To invoke the Pattern Editor, click the ellipsis button of the SeriesLabelBase.TextPattern property in the Properties window, as shown below.

  5. To specify the “{V}” pattern, double click the Value placeholder in the “Placeholders:” column of the Pattern Editor.

  6. Invoke the Pattern Editor , as you did in the previous step.

  7. Select Currency from the “Format:” drop-down list and click the second format.

  8. To add the Argument placeholder before the “{V:$0}” pattern, place the mouse cursor at the start line position in the “Pattern:” column. Then, double click Argument in the “Placeholders:” column.

  9. Finally, specify the colon separator after the “{A}” pattern in the “Pattern:” column.

The result is shown in the following image.

In addition, you can perform similar operations for the Pie chart’s legend (e.g., to make it display values as percentages and show the arguments as well).

To learn how to do this, refer to How to: Show Currency Values in the Legend of a Pie Chart.

See Also

Series Point Labels

Pattern Editor