Javascript 断开连接的图形上缺少悬停标记
我面临一个问题,我不确定这是highcharts插件中的错误还是编程错误 我使用空值绘制一个只有一个系列的断开线图,但悬停标记似乎有问题:其中一些(在第一行的顶部和第二行的底部)似乎没有出现。代码很简单,但我找不到导致这种情况的原因 下面是一个重现问题的示例:(2002年26月更新) 这里是代码(2002年26月更新):Javascript 断开连接的图形上缺少悬停标记,javascript,highcharts,Javascript,Highcharts,我面临一个问题,我不确定这是highcharts插件中的错误还是编程错误 我使用空值绘制一个只有一个系列的断开线图,但悬停标记似乎有问题:其中一些(在第一行的顶部和第二行的底部)似乎没有出现。代码很简单,但我找不到导致这种情况的原因 下面是一个重现问题的示例:(2002年26月更新) 这里是代码(2002年26月更新): $(函数(){ var图; $(文档).ready(函数(){ 图表=新的高点图表。图表({ 图表:{ renderTo:'容器', 键入:“行”, marginRight:1
$(函数(){
var图;
$(文档).ready(函数(){
图表=新的高点图表。图表({
图表:{
renderTo:'容器',
键入:“行”,
marginRight:130,
marginBottom:25,
zoomType:'xy'
},
标题:{
文字:“月平均气温”,
x:-20/中心
},
副标题:{
文字:“来源:WorldClimate.com”,
x:-20
},
工具提示:{
格式化程序:函数(){
返回“+this.series.name+”
+
这个.x+':'+这个.y+'°C';
}
},
打印选项:
{
行:{
标记:
{
启用:false,
}
}
},
图例:{
布局:“垂直”,
对齐:“右”,
垂直排列:“顶部”,
x:-10,
y:100,
边框宽度:0
},
系列:[{
名称:“红色”,
数据:[[0,0],[1,1],[2,2]
无效的
,[4,4],[5,5],[6,6]
无效的
,[2,0],[3,1],[4,2]
无效的
,[6,4],[7,5],[8,6]
无效的
,[12,0],[13,1],[14,2]
无效的
,[16,4],[17,5],[18,6]
无效的
,[22,0],[23,1],[24,2]
无效的
,[26,4],[27,5],[28,6]
无效的
,[32,0],[33,1],[34,2]
无效的
,[36,4],[37,5],[38,6]
无效的
,[34,0],[35,1],[36,2]
无效的
,[38,4],[39,5],[40,6]
无效的
,[36,0],[37,1],[38,2]
无效的
,[40,4],[41,5],[42,6]
无效的
,[40,2],[41,2],[42,3]
无效的
,[47,8],[48,10],[49,11]
],
颜色:“红色”
}
,{
名称:“蓝色”,
数据:[[2,2],[3,3],[4,4]
无效的
,[8,8],[9,10],[10,12]
无效的
,[4,2],[5,3],[6,4]
无效的
,[10,8],[11,10],[12,12]
无效的
,[14,2],[15,3],[16,4]
无效的
,[20,8],[21,10],[22,12]
无效的
,[24,2],[25,3],[26,4]
无效的
,[30,8],[31,10],[32,12]
无效的
,[34,2],[35,3],[36,4]
无效的
,[40,8],[41,10],[42,12]
无效的
,[36,2],[37,3],[38,4]
无效的
,[42,8],[43,10],[44,12]
无效的
,[38,2],[39,3],[40,4]
无效的
,[44,8],[45,10],[46,12]
无效的
,[42,3],[41,3],[42,4]
无效的
,[49,11],[52,12],[53,12]
],
颜色:“蓝色”
}
,{
名称:'绿色',
数据:[[6,6],[7,7],[8,8]
无效的
,[10,12],[11,15],[12,19]
无效的
,[8,6],[9,7],[10,8]
无效的
,[12,12],[13,15],[14,19]
无效的
,[8,6],[9,7],[10,8]
无效的
,[12,12],[13,15],[14,19]
无效的
,[18,6],[19,7],[20,8]
无效的
,[22,12],[23,15],[24,19]
无效的
,[28,6],[29,7],[30,8]
无效的
,[32,12],[33,15],[34,19]
无效的
,[38,6],[39,7],[40,8]
无效的
,[42,12],[43,15],[44,19]
无效的
,[40,6],[41,7],[42,8]
无效的
,[44,12],[45,15],[46,19]
无效的
,[42,6],[43,7],[44,8]
无效的
,[46,12],[47,15],[48,19]
无效的
,[42,4],[45,5],[47,8]
无效的
,[53,12],[54,13],[55,14]
],
颜色:“绿色”
}]
});
});
}))
你知道如何让那些标记重新出现吗
提前谢谢
更新日期:2002年2月26日:我一直在测试其他场景以确定此问题的原因,下面是我发现的:
-当线之间的距离太近时(在X轴上)
-缩放没有帮助,即使在标记应该出现的地方完全缩放也不会使其出现。
-无论y值是否相同,都会出现此问题 更新25/04: 例如,您可以在尝试将点悬停在绿色系列的[47,15]上时看到该错误。与[47,15]点不同的是[47,8]点处于“悬停”状态,无论我尝试什么(比如精确缩放),我都无法“悬停”[47,15]点 我已经用更多的例子更新了JSFIDLE链接和上面的代码来说明这个问题
$(function () {
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'line',
marginRight: 130,
marginBottom: 25,
zoomType: 'xy'
},
title: {
text: 'Monthly Average Temperature',
x: -20 //center
},
subtitle: {
text: 'Source: WorldClimate.com',
x: -20
},
tooltip: {
formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+
this.x +': '+ this.y +'°C';
}
},
plotOptions :
{
line : {
marker :
{
enabled: false,
}
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -10,
y: 100,
borderWidth: 0
},
series: [{
name: 'Red',
data: [[0,0],[1,1],[2,2]
,null
,[4,4],[5,5],[6,6]
,null
,[2,0],[3,1],[4,2]
,null
,[6,4],[7,5],[8,6]
,null
,[12,0],[13,1],[14,2]
,null
,[16,4],[17,5],[18,6]
,null
,[22,0],[23,1],[24,2]
,null
,[26,4],[27,5],[28,6]
,null
,[32,0],[33,1],[34,2]
,null
,[36,4],[37,5],[38,6]
,null
,[34,0],[35,1],[36,2]
,null
,[38,4],[39,5],[40,6]
,null
,[36,0],[37,1],[38,2]
,null
,[40,4],[41,5],[42,6]
,null
,[40,2],[41,2],[42,3]
,null
,[47,8],[48,10],[49,11]
],
color: 'red'
}
,{
name: 'Blue',
data: [[2,2],[3,3],[4,4]
,null
,[8,8],[9,10],[10,12]
,null
,[4,2],[5,3],[6,4]
,null
,[10,8],[11,10],[12,12]
,null
,[14,2],[15,3],[16,4]
,null
,[20,8],[21,10],[22,12]
,null
,[24,2],[25,3],[26,4]
,null
,[30,8],[31,10],[32,12]
,null
,[34,2],[35,3],[36,4]
,null
,[40,8],[41,10],[42,12]
,null
,[36,2],[37,3],[38,4]
,null
,[42,8],[43,10],[44,12]
,null
,[38,2],[39,3],[40,4]
,null
,[44,8],[45,10],[46,12]
,null
,[42,3],[41,3],[42,4]
,null
,[49,11],[52,12],[53,12]
],
color: 'blue'
}
,{
name: 'Green',
data: [[6,6],[7,7],[8,8]
,null
,[10,12],[11,15],[12,19]
,null
,[8,6],[9,7],[10,8]
,null
,[12,12],[13,15],[14,19]
,null
,[8,6],[9,7],[10,8]
,null
,[12,12],[13,15],[14,19]
,null
,[18,6],[19,7],[20,8]
,null
,[22,12],[23,15],[24,19]
,null
,[28,6],[29,7],[30,8]
,null
,[32,12],[33,15],[34,19]
,null
,[38,6],[39,7],[40,8]
,null
,[42,12],[43,15],[44,19]
,null
,[40,6],[41,7],[42,8]
,null
,[44,12],[45,15],[46,19]
,null
,[42,6],[43,7],[44,8]
,null
,[46,12],[47,15],[48,19]
,null
,[42,4],[45,5],[47,8]
,null
,[53,12],[54,13],[55,14]
],
color: 'green'
}]
});
});
tooltip: {
shared: true,
formatter: function () {
var s = '<b>' + this.x + '</b>';
$.each(this.points, function (i, point) {
s += '<br/>' + point.series.name + ': ' + point.y + 'm';
});
return s;
},
},
line : {
marker :
{
enabled: true,
}
}