Question

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...

Was it helpful?

Solution

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.

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top