How to Customize Category Axis Labels in Bold BI Charts
When creating visualizations in Bold BI, you may find the need to customize the category axis labels of a chart widget. This can be particularly useful when you want to display a more concise or meaningful label than the one provided by your data source. For example, you might want to show country codes instead of full country names on the axis of a chart. This article will guide you through the process of customizing category axis labels using an expression column.
Steps to Customize Category Axis Labels
To customize the category axis labels in a chart widget, follow these steps:
Configure the Chart Widget: Begin by configuring the chart widget with the required columns. For our example, we will configure the chart widget with Country Name and Sales Amount
Create an Expression Column: Next, create an expression column that will map each country name to its corresponding country code.
Here is a sample expression that maps country names to their respective codes:IF([Country]='Australia','AU', IF([Country]='Belgium','BE', IF([Country]='Brazil','BR', IF([Country]='Colombia','CO', IF([Country]='Denmark','DK', IF([Country]='Germany','DE',''))))))
Bind the Expression Column: Finally, bind the created expression column in the
Column
section of the widget. This will replace the full country names with the country codes you have specified in the expression.
Limitation
- This expression column can be utilized to personalize the category axis labels of a chart widget. It is recommended to use this feature when the bound column contains less than 10 records, as manually entering data in an expression column may become difficult with a larger number of records…
- Also, if a new country name is added to the data source dynamically, the expression will not automatically accommodate the new entry. The label for the new country will appear as an empty string. To resolve this, you must update the expression column to include the new country name and its corresponding code.
NOTE: Additionally, we have also provided support to replace the value of a column in Bold BI. With this additional support, you can achieve the same requirement and refer to this section for configuring the Replace Value Support at the Column Level.
Additional References
For more information on configuring expression fields in Bold BI, you can refer to the following resource:
By following the steps outlined in this article, you can effectively customize the category axis labels in your Bold BI charts to better suit your reporting and visualization needs.