Highcharts Demo
author(s): Øystein Moseng
by Anvesh1992
HTML
<!-- script src="https://code.highcharts.com/highcharts.js"></script -->
<script src="https://code.highcharts.com/stock/highstock.js"></script>
<div id="container" style="height: 400px; width: 800px"></div>
JavaScript
Highcharts.stockChart('container', {
title: {
text: 'The top series snaps hover along X axis'
},
plotOptions: {
line: {
marker: {
enabled: true,
radius: 4
}
},
series: {
findNearestPointBy: 'xy'
}
},
tooltip: {
shared: true,
},
xAxis: {ordinal:false},
series: [{
//findNearestPointBy: 'xy',
// Hover at [3.5, 6] to demo x-dimension search
// Compare to Series 2 behavior at [5.5, 3]
data: [
[1496196000000, -1],
[1496196000004, -1],
[1496196000005, 12],
[1496196000006, -1],
[1496196000010, -1],
]
}, {
//findNearestPointBy: 'xy',
// Hover at [1, 4] to demo xy-dimension search.
// Useful when having multiple points on the same x-value.
data: [
[1496196000000, 3],
[1496196000004, 3],
[1496196000006, 3],
[1496196000010, 3],
]
}]
});