Skip to content

Instantly share code, notes, and snippets.

@nodeninja
Created July 10, 2012 10:46
Show Gist options
  • Save nodeninja/3082624 to your computer and use it in GitHub Desktop.
Save nodeninja/3082624 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