highstock
HTML
<script src="http://github.highcharts.com/bugfix/highstock.js"></script>
<div id="container" style="height: 300px"></div>
JavaScript
$(function() {
(function(H) {
H.wrap(H.Series.prototype, 'gappedPath', function(proceed) {
var gapSize = this.options.gapSize,
xAxis = this.xAxis,
points = this.points.slice(),
i = points.length - 1;
if (gapSize && i > 0) { // #5008
// extension for ordinal breaks
while (i--) {
if (points[i + 1].x - points[i].x > gapSize) {
points.splice( // insert after this one
i + 1,
0, {
isNull: true
}
);
}
}
}
return this.getGraphPath(points);
})
}(Highcharts))
var data = function() {
var array = [];
for (var i = 0; i < 1000; i++) {
if (i % 25 === 0) {
array.push([90000000 + 3600 * 1000 * i + 3600 * 500, 3 * Math.random()]);
} else {
array.push([90000000 + 3600 * 1000 * i, 3 * Math.random()]);
}
}
return array;
},
data1 = data(),
data2 = data();
$('#container').highcharts('StockChart', {
xAxis: {
ordinal: false
},
yAxis: [{
height: '50%',
lineWidth: 2
}, {
top: '50%',
height: '50%',
offset: 0,
lineWidth: 2
}],
plotOptions: {
line: {
gapSize: 3600 * 1000,
dataGrouping: {
enabled: false
}
}
},
series: [{
data: data1
}, {
yAxis: 1,
data: data2
}]
});
});