$.getJSON('https://www.highcharts.com/samples/data/aapl-ohlcv.json', function (data) {
// split the data set into ohlc and volume
var ohlc = [],
volume = [],
dataLength = data.length,
// set the allowed units for data grouping
groupingUnits = [[
'week', // unit name
[1] // allowed multiples
], [
'month',
[1, 2, 3, 4, 6]
]],
i = 0;
for (i; i < dataLength; i += 1) {
ohlc.push([
data[i][0], // the date
data[i][1], // open
data[i][2], // high
data[i][3], // low
data[i][4] // close
]);
volume.push([
data[i][0], // the date
data[i][5] // the volume
]);
}
// create the chart
Highcharts.stockChart('container', {
rangeSelector: {
enabled: false
},
credits: {
enabled: !1
},
scrollbar: {
enabled: false
},
navigator: {
enabled: false
},
title: {
text: 'AAPL Historical'
},
yAxis: [{
//visible : false,
gridLineWidth:0,//Set this to zero
labels: {
enabled: false
//align: 'right',
//x: -3
},
title: {
text: ''
},
height: '60%',
lineWidth: 0,
plotLines: [{ //đường thẳng nằm ngang theo y có thể dùng cho x để lấy đường dọc
color: 'orange', // Color value
dashStyle: 'longdashdot', // Style of the plot line. Default to solid
value: 154.74, // Value of where the line will appear
width: 1 // Width of the line
}],
resize: {
enabled: true
}
},...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.