Chapter 6: Range chart of market index (unsorted fields)
Convert series data in market index chart into range series: High & Low -> Column range and UNSORTED Open & Close -> arearange
by JoeKuan
HTML
<script type="text/javascript" src="http://code.highcharts.com/highcharts.js"></script>
<script type="text/javascript" src="http://code.highcharts.com/highcharts-more.js"></script>
<body>
<div style="margin: 5px 60px 5px 5px; " id='container'></div>
</body>
JavaScript
$(document).ready(function() {
var volColor = '#AA4643';
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
spacingRight: 30,
},
title: {
text: 'Market Data: Nasdaq 100'
},
subtitle: {
text: '2011 - 2012'
},
xAxis: {
categories: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ],
labels: {
y: 17
},
gridLineDashStyle: 'dot',
gridLineWidth: 1,
lineWidth: 2,
lineColor: '#92A8CD',
tickWidth: 3,
tickLength: 6,
tickColor: '#92A8CD',
// Need extra because there is a bug in Highcharts
minPadding: 0.04,
offset: 1,
},
yAxis: [{
title: {
text: 'Nasdaq index'
},
minorGridLineColor: '#D8D8D8',
minorGridLineDashStyle: 'dashdot',
gridLineColor: '#8AB8E6',
alternateGridColor: {
linearGradient: [0, 250, 500, 250],
stops: [ [0, '#FAFCFF' ],
[0.2, 'F7FBFF' ],
[0.5, '#F5FAFF'] ,
[0.8, '#E0F0FF'] ,
[1, '#D6EBFF'] ]
},
lineWidth: 2,
lineColor: '#92A8CD',
tickWidth: 3,
tickLength: 6,
tickColor: '#92A8CD'
}, {
title: {
text: 'Volume'
},
labels: {
style: {
color: volColor
}
},
lineWidth:...