<title>Highstock Example</title>
<script type="text/javascript">
-
- $.get('/samples/stock/demo/flags-general/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('-');
-
- x = Date.UTC(date[2], date[1] - 1, date[0]);
-
- if (point.length > 1) {
- 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: {
- type: 'datetime',
- maxZoom: 14 * 24 * 3600000, // fourteen days
- title: {
- text: null
- }
- },
- yAxis: {
- title: {
- text: 'Exchange rate'
- }
- },
-
- tooltip: {
- style: {
- width: 200
- }
- },
-
- series: [{
- name: 'USD to EUR',
- data: data,
- id: 'dataseries'
- },
- // the event marker flags
- {
- type: 'flags',
- data: [{
- x: Date.UTC(2011, 3, 25),
- title: 'H',
- text: 'Euro Contained by Channel Resistance',
- url: 'http://biz.yahoo.com/fxcm/110425/428190176.html?.v=1'
- }, {
- x: Date.UTC(2011, 3, 28),
- title: 'G',
- text: 'EURUSD: Bulls Clear Path to 1.50 Figure',
- url: 'http://biz.yahoo.com/fxcm/110428/805974068.html?.v=1'
- }, {
- x: Date.UTC(2011, 4, 4),
- title: 'F',
- text: 'EURUSD: Rate Decision to End Standstill',
- url: 'http://biz.yahoo.com/fxcm/110504/1529297364.html?.v=1'
- }, {
- x: Date.UTC(2011, 4, 5),
- title: 'E',
- text: 'EURUSD: Enter Short on Channel Break',
- url: 'http://biz.yahoo.com/fxcm/110505/402098946.html?.v=1'
- }, {
- x: Date.UTC(2011, 4, 6),
- title: 'D',
- text: 'Forex: U.S. Non-Farm Payrolls Expand 244K, U.S. Dollar Rally Cut Short By Risk Appetite',
- url: 'http://biz.yahoo.com/fxcm/110506/1748508439.html?.v=1'
- }, {
- x: Date.UTC(2011, 4, 6),
- title: 'C',
- text: 'US Dollar: Is This the Long-Awaited Recovery or a Temporary Bounce?',
- url: 'http://biz.yahoo.com/fxcm/110506/1855972157.html?.v=1'
- }, {
- x: Date.UTC(2011, 4, 9),
- title: 'B',
- text: 'EURUSD: Bearish Trend Change on Tap?',
- url: 'http://biz.yahoo.com/fxcm/110509/292979871.html?.v=1'
- }],
- onSeries: 'dataseries',
- shape: 'circlepin',
- width: 16,
- cursor: 'pointer'
- }]
- });
+ \r
+ $.get('/samples/stock/demo/flags-general/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
+ x = Date.UTC(date[2], date[1] - 1, date[0]);\r
+ \r
+ if (point.length > 1) {\r
+ data.push([\r
+ x, // time \r
+ parseFloat(point[4]) // close\r
+ ]);\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
+ type: 'datetime',\r
+ maxZoom: 14 * 24 * 3600000, // fourteen days\r
+ title: {\r
+ text: null\r
+ }\r
+ },\r
+ yAxis: {\r
+ title: {\r
+ text: 'Exchange rate'\r
+ }\r
+ },\r
+ \r
+ tooltip: {\r
+ style: {\r
+ width: 200\r
+ }\r
+ },\r
+ \r
+ series: [{\r
+ name: 'USD to EUR',\r
+ data: data,\r
+ id: 'dataseries'\r
+ }, \r
+ // the event marker flags\r
+ {\r
+ type: 'flags',\r
+ data: [{\r
+ x: Date.UTC(2011, 3, 25),\r
+ title: 'H',\r
+ text: 'Euro Contained by Channel Resistance',\r
+ url: 'http://biz.yahoo.com/fxcm/110425/428190176.html?.v=1' \r
+ }, {\r
+ x: Date.UTC(2011, 3, 28),\r
+ title: 'G',\r
+ text: 'EURUSD: Bulls Clear Path to 1.50 Figure',\r
+ url: 'http://biz.yahoo.com/fxcm/110428/805974068.html?.v=1' \r
+ }, {\r
+ x: Date.UTC(2011, 4, 4),\r
+ title: 'F',\r
+ text: 'EURUSD: Rate Decision to End Standstill',\r
+ url: 'http://biz.yahoo.com/fxcm/110504/1529297364.html?.v=1' \r
+ }, {\r
+ x: Date.UTC(2011, 4, 5),\r
+ title: 'E',\r
+ text: 'EURUSD: Enter Short on Channel Break',\r
+ url: 'http://biz.yahoo.com/fxcm/110505/402098946.html?.v=1'\r
+ }, {\r
+ x: Date.UTC(2011, 4, 6),\r
+ title: 'D',\r
+ text: 'Forex: U.S. Non-Farm Payrolls Expand 244K, U.S. Dollar Rally Cut Short By Risk Appetite',\r
+ url: 'http://biz.yahoo.com/fxcm/110506/1748508439.html?.v=1'\r
+ }, {\r
+ x: Date.UTC(2011, 4, 6),\r
+ title: 'C',\r
+ text: 'US Dollar: Is This the Long-Awaited Recovery or a Temporary Bounce?',\r
+ url: 'http://biz.yahoo.com/fxcm/110506/1855972157.html?.v=1'\r
+ }, {\r
+ x: Date.UTC(2011, 4, 9),\r
+ title: 'B',\r
+ text: 'EURUSD: Bearish Trend Change on Tap?',\r
+ url: 'http://biz.yahoo.com/fxcm/110509/292979871.html?.v=1'\r
+ }],\r
+ onSeries: 'dataseries',\r
+ shape: 'circlepin',\r
+ width: 16,\r
+ cursor: 'pointer' \r
+ }]\r
+ });\r
});
</script>
</head>
<body>
- <script type="text/javascript" src="http://www.highcharts.com/js/testing-stock.js"></script>
-
+ <script type="text/javascript" src="http://www.highcharts.com/js/testing-stock.js"></script>\r\r
+ \r
<div id="container" style="height: 500px"></div>
</body>
</html>