Highcharts Stock Demo
author(s):
Torstein Hønsi
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/jstimezonedetect/1.0.6/jstz.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dayjs/1.8.14/dayjs.min.js"></script>
<div id="container" style="height: 400px; min-width: 600px"></div>
<script src="https://code.highcharts.com/stock/highstock.js"></script>
<script src="https://code.highcharts.com/stock/modules/exporting.js"></script>
<script type="text/javascript" src="https://www.highcharts.com/samples/data/usdeur.js"></script>
JavaScript
Highcharts.chart('container', {
xAxis: {
type: 'datetime'
},
tooltip: {
xDateFormat: '%A, %B %d, %Y UTC ' + dayjs().format("Z") ,
shared: true
},
plotOptions: {
series: {
pointStart: Date.UTC(2012, 0, 1),
pointInterval: 24 * 3600 * 1000
}
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}, {
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4].reverse()
}]
});