Home Forums StockChart Support rangeChanged not triggering on zoom Reply To: rangeChanged not triggering on zoom

#33497

I finally figured it out… rangeChange on the stockChart doesn’t trigger, but rangeChange on the underline chart does, so had to register the handler on each chart as well.

stock chart event != chart event, so also had to normalize to get it working

on stockChart options

rangeChanged: function(e) {
// normalize to show StockChart
if (isUndefined(e.stockChart)) {
e.stockChart = self.lastChart
e.maximum = e.axisX[0].viewportMaximum
e.minimum = e.axisX[0].viewportMinimum
}
opts.onRangeChange(e) // real handler
},

then for each chart

for (var i = 0; i < options.charts.length; i++) {
options.charts[i].zoomEnabled = true
options.charts[i].rangeChanged = options.rangeChanged
}