Is there a way determine a constant range for the X axis, and the values will be changed by the Zoom ?

For example – if I have 5000 points overall from year 2000 to 2017, and the range is 50, it will show me 5000/50 points “together” as 1 line. and if i’m at zoom level of 3000 points in the X axis, it will show me 3000/50 points “together”, and if the zoom level is very large, and I see only <50 points in the X axis, it will show me 50/50 = 1 points “together” – it’s the basic “resolution” like I have now – sorted by single days…

Currently i’m using this graph with zoomable option:

https://canvasjs.com/javascript-charts/multi-series-line-chart/

it’s great, but to implement what I want, I need to react to event of zooming on some X – range, and change the Data to present accordingly accumulated in range. How can I do it ?