# Override the name

**URL:** <https://community.spicecrm.io/t/override-the-name/780>\
**Category:** KReporter\
**Created:** [August 19, 2025, 3:30pm UTC](https://community.spicecrm.io/t/override-the-name/780 "2025-08-19T15:30:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsp](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rsp](https://community.spicecrm.io/u/rsp)\
**Post date:** [August 19, 2025, 3:30pm UTC](https://community.spicecrm.io/t/override-the-name/780/1 "2025-08-19T15:30:25Z")

</div>

We have a kreport with the text field, it could have three values A,B & C. In visualize, we have Bar Chart & it is displaying the A, B & C as legend values & on the x-axis instead of that we want to display Apple, Banana & Coconut in the legend or axis.

@maretval How to do it?

---

<div class="post-metadata">

**Author:** ![rsp](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rsp](https://community.spicecrm.io/u/rsp)\
**Post date:** [August 19, 2025, 3:38pm UTC](https://community.spicecrm.io/t/override-the-name/780/2 "2025-08-19T15:38:21Z")

</div>

Will this work, if we put this in the customFunction of the field?

> CASE {t}.{f}  
> WHEN ‘A’ THEN ‘Apple’  
> WHEN ‘B’ THEN ‘Banana’  
> WHEN ‘C’ THEN ‘Coconut’  
> ELSE {t}.{f}  
> END

Or is there any other way to do it?

---

<div class="post-metadata">

**Author:** ![rsp](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rsp](https://community.spicecrm.io/u/rsp)\
**Post date:** [August 19, 2025, 4:05pm UTC](https://community.spicecrm.io/t/override-the-name/780/3 "2025-08-19T16:05:22Z")

</div>

I think this will update labels for the axis. But how to update the label of Legends too?

Is there any way to do this?

---

<div class="post-metadata">

**Author:** ![maretval](https://avatars.discourse-cdn.com/v4/letter/m/b38774/32.png) [@maretval](https://community.spicecrm.io/u/maretval)\
**Post date:** [August 20, 2025, 9:02am UTC](https://community.spicecrm.io/t/override-the-name/780/4 "2025-08-20T09:02:40Z")

</div>

@rsp Your text field shall be defined as an enum field. Then you will have the label for the x -axis.  
Here an example with opportunity stages

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/spicecrm/original/1X/0a968a84b03cc117f94cd2940e3d43b7206dc402.png)

Regarding the legend:  
It uses the label of the field set in “dataseries” in a 1-dimensional chart

To get enum labels there you will need a 2 dimensional report.  
User HighCharts for stacked bar chart.  
Here an example of Opportunites by country (dimension 1) and sales stage (dimension 2)

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/spicecrm/original/1X/ebc0cb8523c527981277b00f30ebd2c6822fdb25.png)
