在HighStock图表导航器中禁用车把 [英] Disabling Handlebars in HighStock charts navigator
本文介绍了在HighStock图表导航器中禁用车把的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经搜索了API,并且有很多禁用和设置滚动条和导航器样式的示例.我想保持两个原封不动,但是禁用了可拖动的车把.我尝试使用这种提琴上的样式:
I've searched through the API and there are lots of examples on disabling and styling both the scroll bar and the navigator. I want to keep both intact but disable the handlebars from being draggable. I tried playing with the styles on this fiddle:
但是根据API,只有backgroundColor和borderColor是可访问的属性.
but only the backgroundColor and borderColor are accessible attributes according to the API.
推荐答案
您可以使用setExtremes:
You can use setExtremes:
xAxis: {
minRange:6 * 30 * 24 * 3600 * 1000,
events: {
afterSetExtremes: function(e) {
var maxDistance = 10 * 30 * 24 * 3600 * 1000; //8 months time
var xaxis = this;
if ((e.max - e.min) > maxDistance) {
var min = e.max - maxDistance;
var max = e.max;
window.setTimeout(function() {
xaxis.setExtremes(min, max);
}, 1);
}
}
}
},
这篇关于在HighStock图表导航器中禁用车把的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文