Last active
December 29, 2015 10:19
-
-
Save zhangsida/7655933 to your computer and use it in GitHub Desktop.
the things to be know about this code are in the comment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http - equiv = "Content-Type" content = "text/html; charset=utf-8" > | |
<title>Highstock Example </title> | |
<script type = "text/javascript" src = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" > </script> | |
<script type = "text/javascript" > | |
$(function () { | |
$.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=range.json&callback=?', function (data) { | |
$('#container').highcharts('StockChart', { | |
chart : { | |
type : 'arearange' | |
}, | |
rangeSelector : { | |
selected : 2 | |
}, | |
title : { | |
text : 'Temperature variation by day' | |
}, | |
tooltip : { | |
valueSuffix : '°C' | |
}, | |
series : [{ | |
name : 'Temperatures', | |
data : data | |
} | |
] | |
}); | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<script src = "../../js/highstock.js"> | |
</script> | |
<script src = "../../js/highcharts-more.js"> | |
</script> | |
<script src = "../../js/modules/exporting.js"> | |
</script> | |
<div id = "container" style = "min-width: 400px; height: 400px; margin: 0 auto"> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Row 8 :$(...) is same with $ (document).ready(...)
Row 9 : $.getJSON is a jQuery AJAX method with the definition:
jQuery.getJSON( url [, data ] [, success( data, textStatus, jqXHR ) ] )
Row 10: highcharts should be assigned as Function to Div-Element or his parents?
for(var i in jQuery('#container')) {
if (jQuery('#container').hasOwnProperty(i)) {
console.log(i, '' + jQuery('#container')[i]);
}
}
for(var i in jQuery('#container'))console.log(i, '' + jQuery('#container')[i]);