HighCharts - Horizontal line with the zoomed average of the values <p>I need to display the average of the values of my 2 datasets, but with a specific characteristic: when the users zoom the chart, the average line is recalculated ONLY with the values of the zoomed area. How is this done?</p> <p>Here is my JS:</p> <pre><code>$(function () { $('#container').highcharts({ chart: { type: 'scatter', zoomType: 'xy' }, title: { text: 'Test' }, subtitle: { text: '' }, xAxis: { type: 'datetime', title: { enabled: true, text: 'Date' }, startOnTick: true, endOnTick: true, showLastLabel: true }, yAxis: { title: { text: '' } }, legend: { layout: 'vertical', align: 'left', verticalAlign: 'top', x: 100, y: 70, floating: true, backgroundColor: (Highcharts.theme &amp;&amp; Highcharts.theme.legendBackgroundColor) || '#FFFFFF', borderWidth: 1 }, plotOptions: { scatter: { marker: { radius: 5, states: { hover: { enabled: true, lineColor: 'rgb(100,100,100)' } } }, states: { hover: { marker: { enabled: false } } }, tooltip: { headerFormat: '&lt;b&gt;{series.name}&lt;/b&gt;&lt;br&gt;', pointFormat: '{point.x} date, {point.y} dose' } } }, series: [{ name: 'ag', color: 'rgba(223, 83, 83, .5)', data: [[1426719600000,0.9659],[1426719600000,0.8928],[1445205600000,1.6428],[1445205600000,1.4711],[1445205600000,1.4209],[1445205600000,1.9574],[1445205600000,1.1226],[1445205600000,0.8159],[1445205600000,1.0114],[1445205600000,0.9168],[1445464800000,1.175],[1445464800000,1.2219],[1445464800000,1.2641],[1445464800000,1.3006],[1445464800000,0.9375],[1445464800000,0.8966],[1445464800000,0.9374],[1445464800000,1.0811]] }, { name: 'cf', color: 'rgba(119, 152, 191, .5)', data: [[1445378400000,2.265],[1445378400000,2.265],[1445378400000,2.265],[1445378400000,2.265],[1445378400000,2.265],[1445378400000,2.265],[1445378400000,2.265],[1445378400000,2.015],[1445378400000,2.265],[1445378400000,2.265],[1445378400000,2.265],[1445378400000,2.265],[1445378400000,2.265],[1445378400000,2.265],[1445378400000,2.265],[1445378400000,2.265],[1445378400000,2.265],[1445378400000,2.265],[1445378400000,2.015],[1445378400000,2.015],[1445378400000,2.015],[1445464800000,1.2254],[1445464800000,1.1065],[1445464800000,1.3482],[1445464800000,1.3015],[1445292000000,1.2297]] }] }); }); </code></pre> <p>Thanks in advance!</p>