Highcharts Demo
author(s):
Torstein Hønsi
by Ying Chor Ding
HTML
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<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
$.getJSON('https://www.highcharts.com/samples/data/jsonp.php?filename=aapl-c.json&callback=?', function (data) {
// Create the chart
Highcharts.stockChart('container', {
// For the Zoom
rangeSelector: {
selected: 0,
buttons: [{
type: 'day',
count: 7,
text: '7 days'
}, {
type: 'day',
count: 15,
text: '15 days'
}, {
type: 'day',
count: 30,
text: '30 days'
},{
type: 'day',
count: 90,
text: '90 days'
}, {
type: 'all',
text: 'All'
}],
//Size for the button
buttonTheme: {
width: 60
},
},
//Disable the mini chart
navigator: {
enabled: false
},
//Disable the scrollbar
scrollbar: {
enabled: false
},
//Disable highchart.com
credits: {
enabled: false
},
//Right to left
yAxis: {
opposite:false
},
title: {
text: 'Enquiry'
},
series: [{
name: 'Enquiry',
data: data,
tooltip: {
valueDecimals: 2
}
}]
});
});