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.

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

    LocateLegendTextPattern

    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).

  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.

    LegendPatterns_ArgumentValue

  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.

      LegendPattern_CurrencySpecifier

      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.

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

    LegendTextPattern_AppliedPattern

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

The result is shown in the following image.

PieLegendTextPattern_Result

See Also