Disabling Handlebars in HighStock charts navigator

后端 未结 1 777
春和景丽
春和景丽 2021-01-28 15:02

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 handleb

1条回答
  •  孤城傲影
    2021-01-28 15:33

    You can use setExtremes:

    http://jsfiddle.net/B7vCR/3/

    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);
                            }
                        }
                    }
                },
    

    0 讨论(0)
提交回复
热议问题