How to Customize Pie Chart Group Labels Using Expressions in Bold Reports
In Bold Reports, pie charts provide an effective way to visualize proportional data. However, when legend labels display full field values, they can become cluttered and difficult to read. This article explains how to customize pie chart group labels using expressions to create shorter, more readable legends.
Steps to Customize Pie Chart Group Labels
Step 1: Add a Pie Chart to the Report
- From the Report Items panel, drag and drop a Pie Chart onto the design surface.
- Configure the chart by mapping the required data fields.
Step 2: Open the Group Settings
- In the Data panel, locate the field added to the Column(s) section.
- Click the Settings (gear) icon next to the field and select Groups.
Step 3: Open the Expression Editor
- In the Group Settings panel, locate the Label field.
- By default, the label uses the field value. Click the Expression (fx) button next to the Label field and select Expression.
Step 4: Apply a Custom Label Expression
- In the Expression Editor, enter the following expression to remove the first five characters from the field value:
- Click OK to save the expression.
=Right(Fields!CUSTOMER_ID.Value, Len(Fields!CUSTOMER_ID.Value) - 5)
Step 5: Preview the Report
Click Preview on the top toolbar to verify the updated group labels.
Before Customization:
The legend displays the complete field value, which may be lengthy and difficult to read.
After Customization:
The legend displays shortened labels, making the chart easier to read and interpret.
Download the sample report here.
Conclusion
Using expressions to customize pie chart group labels helps improve chart readability without modifying the underlying data. Functions such as Right and Len enable you to display concise, user-friendly labels while preserving the original field values.
Related Articles
How to Customize Chart Legends in Bold Reports Designer
How to Customize Legend Text for Multiple Series in Bold Reports Designer