Chapter 2: Adjusting Intervals and Background (2)
add striping effect and shading to the intervals and change the interval lines a similar range with the stripes
by JoeKuan
HTML
<script type="text/javascript" src="http://code.highcharts.com/highcharts.js"></script>
<body>
<div style="margin: 5px 60px 5px 5px; " id='container'></div>
</body>
JavaScript
$(document).ready(function() {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
height: 250,
spacingRight: 30
},
title: {
text: 'Market Data: Nasdaq 100'
},
subtitle: {
text: 'May 11, 2012'
},
xAxis: {
type: 'datetime',
// Format 24 hour time to AM/PM
dateTimeLabelFormats: {
hour: '%I:%M %P'
}
},
yAxis: {
title: {
text: null
},
tickInterval: 10,
minorTickInterval: 5,
minorGridLineColor: '#ADADAD',
minorGridLineDashStyle: ' dashdot',
gridLineColor: '#8AB8E6',
alternateGridColor: {
linearGradient: {
x1: 0, y1: 1,
x2: 1, y2: 1
},
stops: [ [0, '#FAFCFF' ],
[0.5, '#F5FAFF'] ,
[0.8, '#E0F0FF'] ,
[1, '#D6EBFF'] ]
}
},
legend: {
enabled: false
},
credits: {
enabled: false
},
series: [{
name: 'Nasdaq',
data: [ [ Date.UTC(2012, 4, 11, 9, 30), 2606.01 ], [ Date.UTC(2012, 4, 11, 10), 2622.08 ],
[ Date.UTC(2012, 4, 11, 10, 30), 2636.03 ],
[ Date.UTC(2012, 4, 11, 11), 2637.78 ], [ Date.UTC(2012, 4, 11, 11, 30), 2639.15 ],
[ Date.UTC(2012, 4, 11, 12), 2637.09 ], [ Date.UTC(2012, 4, 11, 12, 30), 2633.38 ],
[ Date.UTC(2012, 4, 11, 13), 2632.23 ], [ Date.UTC(2012, 4, 11, 13, 30), 2632.33 ],
...