<title>Highstock Example</title>
<script type="text/javascript">
- \r
- $.get('/samples/stock/demo/line-markers/data.csv', function(csv) {\r
- \r
- // parse the CSV data\r
- var data = [], header, comment = /^#/, x;\r
- \r
- $.each(csv.split('\n'), function(i, line){\r
- if (!comment.test(line)) {\r
- if (!header) {\r
- header = line;\r
- }\r
- else {\r
- var point = line.split(';'), \r
- date = point[0].split('-');\r
- \r
- if (point.length > 1) {\r
- x = Date.UTC(date[2], date[1] - 1, date[0]);\r
- \r
- data.push([\r
- x, // time \r
- parseFloat(point[4]) // close\r
- ]);\r
- }\r
- }\r
- }\r
- });\r
- \r
- // Create the chart \r
- window.chart = new Highcharts.StockChart({\r
- chart: {\r
- renderTo: 'container'\r
- },\r
- \r
- rangeSelector: {\r
- selected: 1\r
- },\r
- \r
- title: {\r
- text: 'USD to EUR exchange rate'\r
- },\r
- \r
- xAxis: {\r
- maxZoom: 14 * 24 * 3600000 // fourteen days\r
- },\r
- yAxis: {\r
- title: {\r
- text: 'Exchange rate'\r
- }\r
- },\r
- \r
- series: [{\r
- name: 'USD to EUR',\r
- data: data,\r
- lineWidth: 0,\r
- marker: {\r
- enabled: true,\r
- radius: 2\r
- }\r
- }]\r
- });\r
+
+ $.get('/samples/stock/demo/line-markers/data.csv', function(csv) {
+
+ // parse the CSV data
+ var data = [], header, comment = /^#/, x;
+
+ $.each(csv.split('\n'), function(i, line){
+ if (!comment.test(line)) {
+ if (!header) {
+ header = line;
+ }
+ else {
+ var point = line.split(';'),
+ date = point[0].split('-');
+
+ if (point.length > 1) {
+ x = Date.UTC(date[2], date[1] - 1, date[0]);
+
+ data.push([
+ x, // time
+ parseFloat(point[4]) // close
+ ]);
+ }
+ }
+ }
+ });
+
+ // Create the chart
+ window.chart = new Highcharts.StockChart({
+ chart: {
+ renderTo: 'container'
+ },
+
+ rangeSelector: {
+ selected: 1
+ },
+
+ title: {
+ text: 'USD to EUR exchange rate'
+ },
+
+ xAxis: {
+ maxZoom: 14 * 24 * 3600000 // fourteen days
+ },
+ yAxis: {
+ title: {
+ text: 'Exchange rate'
+ }
+ },
+
+ series: [{
+ name: 'USD to EUR',
+ data: data,
+ lineWidth: 0,
+ marker: {
+ enabled: true,
+ radius: 2
+ }
+ }]
+ });
});
</script>
</head>
<body>
- <script type="text/javascript" src="http://www.highcharts.com/js/testing-stock.js"></script>\r\r
- \r
+ <script type="text/javascript" src="http://www.highcharts.com/js/testing-stock.js"></script>
+
<div id="container" style="height: 500px"></div>
</body>
</html>