Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/384.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Highcharts工具提示系列名称前的奇怪字符_Javascript_Charts_Highcharts - Fatal编程技术网

Javascript Highcharts工具提示系列名称前的奇怪字符

Javascript Highcharts工具提示系列名称前的奇怪字符,javascript,charts,highcharts,Javascript,Charts,Highcharts,我有一个Highcharts图表,出于某种原因,它只在数据点弹出窗口上显示系列标题前的奇数字符。我使用默认的弹出窗口和highcharts 4.0.1 目前,我将所有系列设置为标题hi,以确保代码中没有任何内容会弄乱这一点。同样,如果我输出countsGraph.series[0].name,我也会得到hi 这是什么原因造成的?不幸的是,由于我对HighCharts.com的访问正在增加,我现在不能做小提琴 下面是我如何创建该系列的 // Create new series if requrie

我有一个Highcharts图表,出于某种原因,它只在数据点弹出窗口上显示系列标题前的奇数字符。我使用默认的弹出窗口和highcharts 4.0.1

目前,我将所有系列设置为标题
hi
,以确保代码中没有任何内容会弄乱这一点。同样,如果我输出
countsGraph.series[0].name,我也会得到
hi

这是什么原因造成的?不幸的是,由于我对HighCharts.com的访问正在增加,我现在不能做小提琴

下面是我如何创建该系列的

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

很可能您使用的编码与UTF-8不同。您只需从以下位置更改,即可删除该字符:


我也有同样的问题。Notepad++中的编码设置为“不带BOM的UTF-8”。当我把它换成“UTF-8”时,它把它修好了。谢谢

更新-这对其他内容产生了一些不良影响,因此我最终在html中添加了:


解决了所有问题的简单方法是使用tooptip

代码如下:

tooltip: {
    pointFormat: '{series.name}: <b>{point.y}</b><br/>',
    shared: true
},
series: {
    code here 
}
工具提示:{
pointFormat:“{series.name}:{point.y}
”, 分享:真的 }, 系列:{ 代码在这里 }

删除highcharts上悬停字符的简单可行的解决方案。

我的页面元设置为
-我还需要做什么?在IDE中设置文件编码<代码>a-
是CP-1250中的表示形式。好主意,但我通过记事本将文件(highcharts)更改为UTF-8,没有BOM,但仍然无法正常工作,因此我添加了一个新的PointFormat,正如您建议的那样,它可以正常工作,但奇怪的是为什么会发生这种情况。感谢您的帮助虽然我也遇到了这个问题,但奇怪的是我能够通过显式地将
pointFormat
设置为默认值来修复它,即带有
\u25CF
字符的值。
<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b><br/>
<span style="color:{series.color}">\u25CF</span> {series.name}: <b>{point.y}</b><br/>
tooltip: {
    pointFormat: '{series.name}: <b>{point.y}</b><br/>',
    shared: true
},
series: {
    code here 
}