CHART - Zoom in Chart Tool
author(s): Torstein Hønsi
by bizamajig
HTML
<div id="container" style="width: 400px"></div>
<script src="http://code.highcharts.com/stock/highstock.js"></script>
<script src="http://code.highcharts.com/stock/modules/exporting.js"></script>
<link href="js/jquery-ui-1.8.22.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-ui.min.js"></script>
JavaScript
var RevenuesModule; // globally available
$(document).ready(function() {
Revenues = new Highcharts.StockChart({
chart: {
renderTo: 'container',
alignTicks: false
},
title: {
text: 'Revenues by Module',
margin: 50
},
xAxis: {
ordinal: false
//tickInterval: 24 * 3600 * 1000
},
yAxis: {
title: {
text: 'Payment Value (£)'
},
min: 0,
tickInterval: 1000,
showFirstLabel: false,
labels: {
x: 0
}
},
rangeSelector: {
selected: 2,
inputBoxStyle: {
top: '40px',
right: '10px'
},
buttons: [
{
type: 'week',
count: 1,
text: '1wk'},
{
type: 'month',
count: 1,
text: '1m'},
{
type: 'month',
count: 3,
text: '3m'},
{
type: 'month',
count: 6,
text: '6m'},
{
type: 'ytd',
text: 'YTD'},
{
type: 'year',
count: 1,
text: '1y'},
{
type: 'all',
text: 'All'}]
},
series: [{
type: 'line',
name: 'DEBTOR',
data: [[1315440000000, 947.00], [1315872000000, 4119.46], [1315958400000, 675.00], [1316044800000, 1050.10], [1316131200000, 840.00], [1316217600000, 490.00], [1316476800000, 1620.54], [1316563200000, 760.00], [1316649600000, 620.00], [1316736000000, 880.00], [1316822400000, 1193.39], [1317081600000, 1005.00], [1317254400000, 990.00], [1317340800000, 475.00], [1317427200000, 1381.00], [1317686400000, 1335.00],...