Highchart X-axis truncate shows strange characters

I have a problem truncating the x-axis labels of highcharts. On my website, when the labels are truncated, it shows these strange characters in this image

My website

When I use the exact same code in JSFiddle, it seems to work fine and instead of weird characters it displays ... how it should

Jsfiddle

Has anyone had the same problem? I use the same imports and the same version of jQuery in JSFiddle.

I thought this might be an encoding problem, but I use UTF-8 for encoding, as in JSFiddle.

 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 

Here is the JSFiddle link, I hope someone can help me.

Thanks in advance!

+6
source share
2 answers

Well, Paweł Fus was right about the first comment he made.

Make sure your HTML file is also encoded in UTF-8. And try to use the file directly from Highcharts CDN, and not local files - perhaps when you save the file, it was converted to CP1250 or something like that.


The problem was solved by saving high-speed libraries as UTF-8.

To do this, I had to change the encoding of eclipse, as she said here How to change the encoding of a text file by default in Eclipse? and then I saved the .js files.

+3
source

try the following: overflow:"justify" for shortcuts that are crowded in your case.

Here is the link: http://api.highcharts.com/highcharts#xAxis.labels

See jsFiddle

+1
source

Source: https://habr.com/ru/post/985340/


All Articles