Skip to content

Instantly share code, notes, and snippets.

@spbooks
Forked from nodeninja/gist:3082624
Created October 25, 2012 01:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spbooks/3949958 to your computer and use it in GitHub Desktop.
Save spbooks/3949958 to your computer and use it in GitHub Desktop.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script src="http://code.highcharts.com/stock/highstock.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$.getJSON('/api/trades', function(data) {
// create the chart
chart = new Highcharts.StockChart({
chart : {
renderTo : 'container'
},
title: {
text: 'Trades'
},
xAxis: {
gapGridLineWidth: 0
},
rangeSelector : {
buttons : [{
type : 'hour',
count : 1,
text : '1h'
}, {
type : 'day',
count : 1,
text : '1D'
}, {
type : 'all',
count : 1,
text : 'All'
}],
selected : 1,
inputEnabled : false
},
series : [{
name : 'NOCK',
type: 'area',
data : data,
gapSize: 5,
tooltip: {
valueDecimals: 2
},
fillColor : {
linearGradient : {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops : [[0, Highcharts.getOptions().colors[0]], [1, 'rgba(0,0,0,0)']]
},
threshold: null
}]
});
});
});
</script>
<div id="container" style="width: 100%; height: 400px"></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment