Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Weird character in front of Highcharts tooltip series names

I have a Highcharts chart which is, for some reason, showing odd characters before the series title only on the data point pop up. I am using the default popup and highcharts 4.0.1.

I currently set all series to have the title hi to ensure nothing in my code was messing this up. Also if I output countsGraph.series[0].name I also get hi.

What is causing this? Unfortunately I cannot make a fiddle at the moment as my access to HighCharts.com is playing up.

Here is how I create the series

// Create new series if requried
if (!series[c]) {
    series[c] = {
        name: "hi",
        data: []
    };
}

enter image description here

like image 594
Chris Avatar asked Jun 03 '14 10:06

Chris


2 Answers

Most probably you are using different coding than UTF-8. You can simply remove that character, by changing pointFormat, from:

<span style="color:{series.color}">\u25CF</span> {series.name}: <b>{point.y}</b><br/>

to:

<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b><br/>

Or, as just @Adam Goodwin pointed out, set default format in your options:

<span style="color:{series.color}">\u25CF</span> {series.name}: <b>{point.y}</b><br/>
like image 80
Paweł Fus Avatar answered Oct 12 '22 23:10

Paweł Fus


I had the same issue. Encoding in Notepad++ was set to 'UTF-8 without BOM'. When I switched it to 'UTF-8' it fixed it. Thanks!

UPDATE - that had some undesirable effects on other stuff, so I ended up adding to the html:

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

and that fixed it all

like image 31
Shane N Avatar answered Oct 13 '22 00:10

Shane N