ZOOM small chart
by katalin_2003
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script type='text/javascript' src="https://highcharts.com/highslide/highslide-full.min.js"></script>
<script type='text/javascript' src="https://highcharts.com/highslide/highslide.config.js"></script>
<link rel="stylesheet" type="text/css" href="https://highcharts.com/highslide/highslide.css"
/>
<div id="container" style="width: 600px; height: 300px; margin: 0 auto"></div>
<div id="container1" style="width: 600px; height: 300px; margin: 0 auto"></div>
JavaScript
createGraph({ // NOTE THE CODE AT THE START
chart: {
renderTo: 'container',
height: 500,
zoomType: 'xy',
type: 'line',
events: {}
},
credits: {
enabled: false
},
title: {
text: 'Silver COT Chart'
},
subtitle: {
text: 'Source CFTC'
},
xAxis: {
type: 'datetime',
labels: {
formatter: function () {
return Highcharts.dateFormat('%a %d %b', this.value);
}
}
},
yAxis: {
opposite: true,
title: {
text: 'Contracts'
},
labels: {
formatter: function () {
return this.value / 1000 + 'k';
}
}
},
tooltip: {
crosshairs: [true, true]
},
plotOptions: {
series: {
marker: {
enabled: false,
symbol: 'circle',
radius: 2,
states: {
hover: {
enabled: true
}
}
}
}
},
series: [{
name: 'Non-Commerial Longs',
color: '#73D549',
data: [51084, 47308, 45185, 26209, 26208, 26629, 24026, 24302, 25572, 23211, 23816, 23577, 25822, 24414, 24084, 23660, 23005, 23571, 23859, 25153, 33947, 36588, 37185, 36537, 38756, 32697, 32101, 38265, 37358, 34248, 29967, 28131, 27439, 30454, 29261, 28761, 28870, 31754, 30936, 34239, 42751, 43078, 48325, 46305, 48890, 47764, 47552, 47290, 50394, 49750, 50937, 50718, 44915, 37883, 38699, 40010, 38570, 40483, 41539, 39180, 39450, 42606, 40818, 40307, 40243, 46004, 52625, 53018, 56278, 59615, 63681, 66066, 62013, 60696, 59112, 54472, 42255, 43251, 42597, 43185, 38480, 37827, 39176, 39876, 47455, 46666, 43464, 40478, 41797, 42146, 51664, 47848, 47287, 48462, 46960, 47495, 44052, 38734, 38105, 40126, 40051, 36721, 35495, 34615, 32438, 36924, 41473, 49357, 48703, 44312, 41886,...