mples > maxX) offsetX++;

            maxYBtc = maxYScrypt = 0;

            var totalsBtc = [];
            var totalsScrypt = [];
            for(key in keyToN) {
                for(i in samples[keyToN[key]].values) {
                    var item = samples[keyToN[key]].values[i];
                    if(samples[keyToN[key]].btc)
                        totalsBtc[i] = (totalsBtc[i] || 0) + item.y;
                    else
                        totalsScrypt[i] = (totalsScrypt[i] || 0) + item.y;
          