| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>Bidi Charts Test</title> |
| 5 | <link rel="stylesheet" href="../../../dijit/themes/claro/claro.css"> |
| 6 | |
| 7 | <script> |
| 8 | dojoConfig = { |
| 9 | parseOnLoad : true, |
| 10 | has : { |
| 11 | 'dojo-bidi' : true |
| 12 | } |
| 13 | } |
| 14 | </script> |
| 15 | <script src='../../../dojo/dojo.js'></script> |
| 16 | |
| 17 | <script> |
| 18 | require([ "dojox/charting/Chart", "dojox/charting/axis2d/Default", |
| 19 | "dojox/charting/plot2d/StackedAreas", |
| 20 | "dojox/charting/action2d/TouchZoomAndPan", |
| 21 | "dojox/charting/action2d/TouchIndicator", |
| 22 | "dojox/charting/themes/Wetland", "dojo/domReady!" ], function( |
| 23 | Chart, Default, StackedAreas, TouchZoomAndPan, TouchIndicator, |
| 24 | Wetland) { |
| 25 | |
| 26 | var c = new Chart("bidiChart"); |
| 27 | c.addPlot("default", { |
| 28 | type : "Default", |
| 29 | markers : false, |
| 30 | lines : true, |
| 31 | tension : 3, |
| 32 | areas : true |
| 33 | }) |
| 34 | |
| 35 | c.addAxis("x", { |
| 36 | type : "Default", |
| 37 | font : "normal normal normal 14pt Tahoma", |
| 38 | vertical : false, |
| 39 | fixUpper : "major", |
| 40 | fixLower : "minor", |
| 41 | stroke : "gray", |
| 42 | majorTick : { |
| 43 | color : "red", |
| 44 | length : 4 |
| 45 | }, |
| 46 | minorTick : { |
| 47 | stroke : "blue", |
| 48 | length : 2 |
| 49 | } |
| 50 | }) |
| 51 | |
| 52 | c.addAxis("y", { |
| 53 | vertical : true, |
| 54 | font : "normal normal normal 14pt Tahoma", |
| 55 | min : 0, |
| 56 | max : 100, |
| 57 | leftBottom : false, |
| 58 | majorTickStep : 10, |
| 59 | minorTickStep : 5, |
| 60 | stroke : "gray", |
| 61 | majorTick : { |
| 62 | stroke : "black", |
| 63 | length : 4 |
| 64 | }, |
| 65 | minorTick : { |
| 66 | stroke : "gray", |
| 67 | length : 2 |
| 68 | } |
| 69 | }) |
| 70 | |
| 71 | c.setTheme(Wetland).addSeries( |
| 72 | "Series A", |
| 73 | [ 8, 7, 3, 2, 5, 7, 9, 10, 2, 10, 14, 16, 29, 13, 16, 15, 20, |
| 74 | 19, 15, 12, 24, 20, 20, 26, 28, 26, 28, 14, 24, 29, 31, |
| 75 | 35, 37, 31, 35, 37, 37, 36, 31, 30, 50, 49, 42, 46, 44, |
| 76 | 40, 47, 43, 48, 47, 51, 52, 52, 51, 54, 57, 58, 50, 54, |
| 77 | 51, 74, 68, 67, 62, 62, 65, 61, 66, 65, 62, 74, 78, 78, |
| 78 | 77, 74, 62, 72, 74, 70, 78, 84, 83, 85, 86, 86, 89, 89, |
| 79 | 85, 86, 86, 98, 73, 93, 91, 92, 92, 99, 93, 94, 92 ]) |
| 80 | new TouchZoomAndPan(c, "default", { |
| 81 | axis : "x", |
| 82 | enableScroll : false, |
| 83 | enableZoom : false |
| 84 | }); |
| 85 | |
| 86 | new TouchIndicator(c, "default", { |
| 87 | series : "Series A", |
| 88 | dualIndicator : false, |
| 89 | font : "normal normal bold 16pt Tahoma", |
| 90 | fillFunc : function(v1, v2) { |
| 91 | if (v2) { |
| 92 | return v2.y > v1.y ? "green" : "red"; |
| 93 | } else { |
| 94 | return "white"; |
| 95 | } |
| 96 | } |
| 97 | }); |
| 98 | |
| 99 | c.render(); |
| 100 | |
| 101 | }); |
| 102 | </script> |
| 103 | </head> |
| 104 | <body class="claro"> |
| 105 | <div id="bidiChart" |
| 106 | style="width: 800px; height: 480px; margin: 10px auto 0px auto;" |
| 107 | direction="rtl"></div> |
| 108 | </body> |
| 109 | </html> |