Highcharts Demo
author(s): Torstein Hønsi
by mizobata
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: 500px"></div>
<div class="info">In an ordinal axis, the points are evenly spaced regardless of the actual X distance between them. In this sample, the space between Friday and Monday is the same as that between Monday and Tuesday.</div>
CSS
.info {
font: 0.7em sans-serif;
padding: 0.5em;
margin: 0.5em;
background: #FCFFC5;
border-radius: 0.5em;
border: 1px solid gray;
}
.info:before {
content: 'i';
margin: 0.5em;
font: 1.5em serif bold;
font-style: italic;
color: green;
}
JavaScript
$.getJSON('https://www.highcharts.com/samples/data/aapl-c.json', function (data) {
// Create the chart
Highcharts.stockChart('container', {
rangeSelector: {
selected: 1
},
title: {
text: 'AAPL Stock Price'
},
xAxis: {
ordinal: false
},
series: [{
name: 'AAPL Stock Price',
data: data,
marker: {
enabled: true,
radius: 3
},
shadow: true,
tooltip: {
valueDecimals: 2
}
}]
});
});