在Highcharts工具提示系列名称前面的奇怪字符 [英] Weird character in front of Highcharts tooltip series names
问题描述
我有一个Highcharts图表,由于某种原因,在系列标题之前只显示数据点弹出的奇数字符。我使用默认弹出窗口和highcharts 4.0.1。
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.
我目前设置所有系列的标题 hi
以确保我的代码中没有什么是搞砸这个。此外,如果我输出 countsGraph.series [0] .name
我也得到 hi
。
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
.
是什么原因造成的?不幸的是,我现在不能做一个小提琴,因为我访问HighCharts.com正在播放。
What is causing this? Unfortunately I cannot make a fiddle at the moment as my access to HighCharts.com is playing up.
这是我如何创建系列
// Create new series if requried
if (!series[c]) {
series[c] = {
name: "hi",
data: []
};
}
推荐答案
很可能你使用的编码不同于UTF- 。您只需删除该字符即可,只需更改 pointFormat
,从:
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/>
到:
<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b><br/>
或者,因为 @Adam Goodwin
在选项中设置默认格式:
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/>
这篇关于在Highcharts工具提示系列名称前面的奇怪字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!