Is it possible to position the zoom buttons in highcharts/highstock?
charts, highcharts, javascript
Solution
Check this: How to position RangeSelector / zoom buttons at custom co-ordinates in Highstock
var orgHighchartsRangeSelectorPrototypeRender = Highcharts.RangeSelector.prototype.render;
Highcharts.RangeSelector.prototype.render = function (min, max) {
orgHighchartsRangeSelectorPrototypeRender.apply(this, [min, max]);
var leftPosition = this.chart.plotLeft,
topPosition = this.chart.plotTop+5,
space = 2;
this.zoomText.attr({
x: leftPosition,
y: topPosition + 15
});
leftPosition += this.zoomText.getBBox().width;
for (var i = 0; i < this.buttons.length; i++) {
this.buttons[i].attr({
x: leftPosition,
y: topPosition
});
leftPosition += this.buttons[i].width + space;
}
};
Problem
As the title says, we have some charts that have two y axis on the left, and as a consequence if the screen is made smaller then the zoom buttons overlap the range inputs. Ideally I would want the zoom buttons to always align to the left of the chart (including axis) Thanks I can't find anything in the API to suggest it's possible http://api.highcharts.com/highstock#rangeSelector