Bar charts: Issues with label if category contains ampersand (&)

1 Answer 55 Views
Charts
Beto
Top achievements
Rank 1
Beto asked on 23 Aug 2021, 09:44 AM | edited on 23 Aug 2021, 10:38 AM

Hi,

I am creating a stacked bar chart with custom labels on the category axis.

If the category includes an ampersand the position of the label will be broken because there is too much space between label and chart axis. This issue does not occur when using the default label.
Encoding the character doesn't help.

Please find a simple reproduction of the issue in my dojo below. I use the latest version of Kendo (2021.2.616)

https://dojo.telerik.com/AloGIgil

 

Thanks in advance for any help.

1 Answer, 1 is accepted

Sort by
0
Patrick | Technical Support Engineer, Senior
Telerik team
answered on 25 Aug 2021, 09:25 PM

Hi Beto,

In order to fix the spacing issue, render the raw values within the template rather then the HTML-encoded value:

            categoryAxis: {
              labels: {
                template: "#= value#"
              },
            },

Please take a look at the following updated Progress Kendo UI Dojo with the changes from above, and let me know if you have any questions.

Regards,
Patrick
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Charts
Asked by
Beto
Top achievements
Rank 1
Answers by
Patrick | Technical Support Engineer, Senior
Telerik team
Share this question
or