Slight improvement, On large datasets the “search speed up” doesn’t work right.
Change this section:
if( document.getElementById("xData"+i) ) { // to speed up the search!
ii_start = document.getElementById("xData"+i).innerHTML-2;
if (ii_start < 0 ) { ii_start = 0 }
}
if (typeof(dataPoints[ chart.options.data[i].name ]) == 'undefined') {
with:
if (typeof(dataPoints[ chart.options.data[i].name ]) == 'undefined' ) {
if( document.getElementById("xData"+i) ) { // to speed up the search!
ii_start = parseInt(document.getElementById("xData"+i).innerHTML);
if (ii_start > 0 ) {
while (ii_start > 0
&& e.entries[0].dataPoint.x.getTime() - chart.options.data[i].dataPoints[ii_start].x.getTime() < 0) {
ii_start = parseInt(ii_start*.9)-6;
}
}
ii_start-= 6;
if (ii_start < 0 ) { ii_start = 0 }
}