Skip to Content
avatar image
Former Member

Crystal Reports Pie Chart - Data Points in Percent format, Legend in Currency format

I am working with Crystal Reports 2013 and to comply with the designs approved by a client I need the data points in the pie chart to show percentage values(100.0%) and the legend to show values in currency format($1.00) I cannot seem to find a way to accomplish this. Using the Chart Expert > Options > Data points I can select a number format. If I select show value and choose percentage, the data points are in correct format in the pie chart but the legend is not in currency format. The only way I can find to change the legend to currency is to select show value, select correct currency format and then deselect show value. This removes the data points completely but makes the legend in correct format. Is there a way for me to have the correct format on both data points and legend?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 12, 2017 at 07:52 PM

    I don't know of a way to add a currency format to the values in the legend on a pie chart.

    It's time consuming, but you could create your own legend to sit next to the chart with the correct format for the values. I've done this before, but it was usually in cases where I knew the maximum number of items that would display on the chart/legend.

    This isn't a better way, but it's an alternative.

    Add comment
    10|10000 characters needed characters exceeded

    • I just used text boxes or formula fields to display the formatted text for each item. I also set each piece of the pie to a specific color, then created a box for each item that would be on the pie chart and positioned it next to the corresponding text box (being sure to set the fill color for the box and the border to the same color). Once all of the boxes and text/formula fields are created and positioned, you can add another box around the items if you want to frame the legend.

      In your case, you can create a formula field that uses the same field that is used to display the percentage on the pie chart. If the field value for the pie chart is in the format 100.0%, then you can divide that value by 100 and concatenate the dollar sign to the beginning ("$" & {@YourFieldValue}, where "YourFieldValue" is the calculated/divided value from the pie chart).

      However, as I mentioned in my original post, this technique is the easiest when the number of items on the chart is well-defined and consistent. If the results will vary, then setting this up dynamically is more complicated if you're new to Crystal Reports.

      Hope this helps.