Highstocks bare bones
Useful for timeline
by Peter Sylwester
HTML
<div id="container" style="height: 150px; width: 100%; position: absolute;"></div>
<script src="http://code.highcharts.com/stock/highstock.js"></script>
<script src="http://code.highcharts.com/stock/modules/exporting.js"></script>
<script type="text/javascript" src="http://www.highcharts.com/samples/data/usdeur.js"></script>
<div id="container2" style="height: 150px; width: 100%;"></div>
CSS
body
{
background-color: steelblue;
}
#container{
clip: rect(40px,1000px, 150px, 0px);
/* clip-path: url(#highcharts-1); */
border: solid 1px red;
}
.floater{
position: absolute;
top: 45px;
left: 0;
width: 141px;
height: 100px;
box-shadow: 0 4px 16px rgba(0,0,0,0.5);
border-radius: 6px;
border: 8px solid white;
}
#container2{
//visibility:hidden;
position: absolute;
top: 200px;
//clip: rect(40px, 260px, 150px, 80px);
border: solid 1px green;
}
JavaScript
$(function() {
$('#container').highcharts('StockChart', {
title: {
text: null
},
xAxis: {
labels: {
enabled: false
}
},
tooltip: {
enabled: false
},
yAxis: {
labels: {
enabled: false
}
},
chart: {
},
scrollbar: {
enabled: false
},
navigator: {
enabled:false
},
rangeSelector: {
selected: 1,
enabled: false
},
credits: {
enabled:false
},
exporting: {
enabled: false
},
plotOptions: {
line: {
enableMouseTracking: true
}
},
series: [{
name: 'USD to EUR',
data: usdeur
}]
});
$('#container2').highcharts('StockChart', {
title: {
text: null
},
xAxis: {
labels: {
enabled: false
}
},
tooltip: {
enabled: false
},
yAxis: {
labels: {
enabled: false
}
},
chart: {
},
scrollbar: {
enabled: false
},
navigator: {
enabled:true
},
rangeSelector: {
selected: 1,
enabled: false
},
credits: {
enabled:false
},
exporting: {
enabled: false
},
plotOptions: {
line: {
enableMouseTracking: false
}
},
series: [{
name: 'USD to EUR',
data: usdeur
}]
});
});
container2.addEventListener('mouseover', function(event) {
// before rendering the layer, do some clipping
var ctx = event.context;
var pixelRatio = 1;//event.frameState.pixelRatio;
ctx.save();
...