문제

I am using Highstock charts with single series having flags on it where x-axis is 'datetime' type and y-axis is any numerical value. Now initially when chart loads I provide bit of padding on x-axis using attribute "max" so that end point doesn't touch the edge (which is working fine) but as I drag the navigator, the padding gets lost and the point touches the edge. Is there any way of maintaining that padding on graph line even after I drag the navigator?
Any help would be greatly appreciated...

도움이 되었습니까?

해결책

Unfortnately maxPadding works only for first time, as you ddescribed, but you can catch adterSetExtremes and then (setExtremes](http://api.highcharts.com/highstock#xAxis.events.setExtremes) to modify range on chart.

다른 팁

Thanks a lot Sebastian Bochan.....It worked for me!!!!. Just in case if anyone needs it. Here is what I have done

events: {
 setExtremes: function(e) {
 if (e.trigger === "navigator") {
 var max=e.max+padding_value;
 var x=this;
 setTimeout(function(){
    x.setExtremes(e.min,max);
    }, 4);
  }
}
},

Padding_value is a variable proving padding every time navigator is triggered

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top