How to: Show Currency Values in the Legend of a Pie Chart
- 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.
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.
Note
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).
- To invoke the Pattern Editor, click the ellipsis button of the SeriesBase.LegendTextPattern property.
Add the Argument and Value placeholders to the ‘Pattern:’ column. To do this, double click the corresponding items in the ‘Placeholders:’ column, sequentially.
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.
Note
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.
Locate the SeriesBase.LegendTextPattern property in the Properties window.
- Change the applied ‘{A}{V:$0}’ pattern string to ‘{A}:{V:$0}’ .
The result is shown in the following image.