JSFiddle - React, Tailwind, and code Playground
by fekkyDev s
HTML
<script src="https://code.highcharts.com/stock/highstock.js"></script>
<script src="https://code.highcharts.com/stock/modules/exporting.js"></script>
<div id="container" style="height: 400px; min-width: 310px"></div>
JavaScript
$(function () {
$.getJSON('https://www.highcharts.com/samples/data/jsonp.php?a=e&filename=aapl-ohlc.json&callback=?', function (data) {
$('#container').highcharts('StockChart', {
rangeSelector: {
selected: 1
},
title: {
text: 'AAPL Stock Price'
},
tooltip: {
pointFormat: '<span style="color:red">\u25CF</span> {series.name}: <b>{point.y}</b><br/>'
},
series: [{
type: 'candlestick',
name: 'AAPL Stock Price',
data: data,
dataGrouping: {
units: [
[
'week',
[1]
], [
'month',
[1, 2, 3, 4, 6]
]
]
}
}]
});
});
});