Highchart - 不应隐藏重叠标签
Highchart - overlapping label should NOT be hidden
有时我的观点靠得很近,而我的高位图隐藏了我的标签。是否有避免这种情况的选项(图表是根据定期刷新的数据绘制的)
在示例中,点 "A TEST" 和 "B - PLEASE SHOW ME" 靠得很近,导致重叠。图表自动隐藏了 B 的标签,但我希望它显示(图表不应超过 3 个点,因此混乱不成问题)
http://jsfiddle.net/4jb4gusj/1/
$(function () {
$('#container').highcharts({
chart: {type: 'scatter'},
title: {text: 'title'},
subtitle: {text: 'subtitle'},
xAxis: {
min: 2,
max: 5,
type: 'linear',
title: {
text: 'Weight'
}
},
yAxis: {
title: {
text: 'Height'
},
min: 110,
max: 170
},
legend: {
Layout : 'vertical'
},
tooltip: {
headerFormat: '<b>{series.name}</b><br>',
pointFormat: '{point.x:%e. %b}: {point.y:.2f} m'
},
plotOptions: {
scatter: {
dataLabels: {
formatter: function() {
return this.series.name ;
},
enabled: true
},
marker: {
radius: 5,
states: {
hover: {
enabled: true,
lineColor: 'rgb(100,100,100)'
}
}
},
states: {hover: {marker: {enabled: false}}},
tooltip: {
headerFormat: '<b>{series.name}</b><br>',
pointFormat: '{point.x} cm, {point.y} kg'
}
}
},
series: [{
name: "A TEST ", data: [[3.91, 140.63]]
}, {
name: "B - PLEASE SHOW ME",
data: [[3.65, 143.68]]
}, {
name: "C TEST ",
data: [[2.69, 172.94]]
}
]
});
});
如果重叠不是问题,请使用
allowOverlap:true,
已更新fiddle here
有时我的观点靠得很近,而我的高位图隐藏了我的标签。是否有避免这种情况的选项(图表是根据定期刷新的数据绘制的)
在示例中,点 "A TEST" 和 "B - PLEASE SHOW ME" 靠得很近,导致重叠。图表自动隐藏了 B 的标签,但我希望它显示(图表不应超过 3 个点,因此混乱不成问题)
http://jsfiddle.net/4jb4gusj/1/
$(function () {
$('#container').highcharts({
chart: {type: 'scatter'},
title: {text: 'title'},
subtitle: {text: 'subtitle'},
xAxis: {
min: 2,
max: 5,
type: 'linear',
title: {
text: 'Weight'
}
},
yAxis: {
title: {
text: 'Height'
},
min: 110,
max: 170
},
legend: {
Layout : 'vertical'
},
tooltip: {
headerFormat: '<b>{series.name}</b><br>',
pointFormat: '{point.x:%e. %b}: {point.y:.2f} m'
},
plotOptions: {
scatter: {
dataLabels: {
formatter: function() {
return this.series.name ;
},
enabled: true
},
marker: {
radius: 5,
states: {
hover: {
enabled: true,
lineColor: 'rgb(100,100,100)'
}
}
},
states: {hover: {marker: {enabled: false}}},
tooltip: {
headerFormat: '<b>{series.name}</b><br>',
pointFormat: '{point.x} cm, {point.y} kg'
}
}
},
series: [{
name: "A TEST ", data: [[3.91, 140.63]]
}, {
name: "B - PLEASE SHOW ME",
data: [[3.65, 143.68]]
}, {
name: "C TEST ",
data: [[2.69, 172.94]]
}
]
});
});
如果重叠不是问题,请使用
allowOverlap:true,
已更新fiddle here