initial commit
[power-brultech.git] / charts / canvas / examples / 14-ohlc(stock)-chart / basic-ohlc-chart.html
1 <!DOCTYPE HTML>\r
2 <html>\r
3 \r
4 <head>\r
5         <script type="text/javascript">\r
6                 window.onload = function () {\r
7                         var chart = new CanvasJS.Chart("chartContainer", {\r
8                                 title: {\r
9                                         text: "Monthly Stock Prices for 2012",\r
10                                 },\r
11                                 axisY: {\r
12                                         includeZero: false,\r
13                                         prefix: "$",\r
14                                         title: "Prices",\r
15                                 },\r
16                                 axisX: {\r
17                                         interval: 1,\r
18                                         intervalType: "month",\r
19                                         valueFormatString: "MMM",\r
20                                 },\r
21                                 data: [\r
22                                 {\r
23                                         type: "ohlc",\r
24                                         dataPoints: [   // Y: [Open, High ,Low, Close]\r
25                                                 { x: new Date(2012, 00, 01), y: [53.65, 56.88, 50.28, 54.99] },\r
26                                                 { x: new Date(2012, 01, 01), y: [55.52, 60.86, 54.97, 57.68] },\r
27                                                 { x: new Date(2012, 02, 01), y: [57.84, 59.18, 55.24, 57.03] },\r
28                                                 { x: new Date(2012, 03, 01), y: [57.12, 57.87, 44.45, 47.30] },\r
29                                                 { x: new Date(2012, 04, 01), y: [47.37, 47.73, 41.59, 42.10] },\r
30                                                 { x: new Date(2012, 05, 01), y: [41.96, 45.56, 41.40, 45.06] },\r
31                                                 { x: new Date(2012, 06, 01), y: [45.46, 46.05, 37.93, 39.58] },\r
32                                                 { x: new Date(2012, 07, 01), y: [39.94, 44.60, 38.97, 42.53] },\r
33                                                 { x: new Date(2012, 08, 01), y: [42.38, 48.90, 41.58, 48.54] },\r
34                                                 { x: new Date(2012, 09, 01), y: [49.36, 49.99, 42.58, 43.42] },\r
35                                                 { x: new Date(2012, 10, 01), y: [43.82, 44.75, 41.59, 44.45] },\r
36                                                 { x: new Date(2012, 11, 01), y: [44.25, 44.40, 41.18, 42.30] }\r
37                                         ]\r
38                                 }\r
39                                 ]\r
40                         });\r
41                         chart.render();\r
42                 }\r
43         </script>\r
44         <script src="../../canvasjs.min.js"></script>\r
45         <title>CanvasJS Example</title>\r
46 </head>\r
47 <body>\r
48         <div id="chartContainer" style="height: 400px; width: 100%;"></div>\r
49 </body>\r
50 \r
51 \r
52 </html>\r