Debian Codegraph @

dojox/charting/tests/BidiSupport/mirror_axisZoomControl.html

raw symbols SCIP
1 <!--[if IE 7]>
2 <!DOCTYPE>
3 <html lang="en">
4 <head>
5 <![endif]-->
6 <!--[if IE 8]>
7 <!DOCTYPE>
8 <html lang="en">
9 <head>
10 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
11 <![endif]-->
12 <![if gte IE 9]>
13 <!DOCTYPE HTML>
14 <html lang="en">
15 <head>
16 <![endif]>
17 <title>Axis Zoom Control</title>
18 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
19 <style type="text/css">
20 @import "../../../../dojo/resources/dojo.css";
21 @import "../../../../dijit/themes/tundra/tundra.css";
22 @import "../../../../dijit/tests/css/dijitTests.css";
23 @import "../../../form/resources/RangeSlider.css";
24 #hrXAxisSlider .dijitSliderProgressBar{
25 height: 12px;
26 overflow: visible;
27 margin-top: -5px;
28 }
29 </style>
30 <script type="text/javascript" src="../../../../dojo/dojo.js" data-dojo-config="isDebug: true, parseOnLoad: true, has:{'dojo-bidi': true}"></script>
31 <script type="text/javascript">
32 var chart1, zoomAxis;
33
34 require(["dojo/dom", "dojo/ready", "dojox/charting/Chart", "dojox/charting/axis2d/Default", "dojox/charting/plot2d/Lines",
35 "dojox/charting/plot2d/StackedAreas", "dojox/charting/plot2d/Grid",
36 "dojox/charting/themes/PlotKit/orange", "dojox/charting/action2d/Tooltip",
37 "dojox/charting/action2d/Magnify", "dojo/parser", "dojox/form/RangeSlider"], function(dom, ready, Chart, Default, Lines, StackedAreas,
38 Grid, orange, Tooltip, Magnify){
39 zoomXAxis = function(){
40 chart1.zoomIn("x", arguments[0]);
41 chart2.zoomIn("x", arguments[0]);
42 dom.byId('minValue').value = arguments[0][0];
43 dom.byId('maxValue').value = arguments[0][1];
44 }
45 ready(function(){
46 chart1 = new Chart("chart1");
47 chart1.setTheme(orange);
48 chart1.addAxis("x", {fixLower: "minor", natural: true, stroke: "grey",
49 majorTick: {stroke: "black", length: 4}, minorTick: {stroke: "gray", length: 2}});
50 chart1.addAxis("y", {vertical: true, min: 0, max: 100, majorTickStep: 5, minorTickStep: 1, stroke: "grey",
51 majorTick: {stroke: "black", length: 4}, minorTick: {stroke: "gray", length: 2}});
52 chart1.addPlot("default", {type: Lines, markers: true});
53 chart1.addSeries("Series A", [
54 8, 7, 3, 2, 5, 7, 9, 10, 2, 10,
55 14, 16, 18, 13, 16, 15, 20, 19, 15, 12,
56 24, 20, 20, 26, 28, 26, 28, 29, 24, 29,
57 31, 35, 37, 31, 35, 37, 37, 36, 31, 30,
58 50, 49, 42, 46, 44, 40, 47, 43, 48, 47,
59 51, 52, 52, 51, 54, 57, 58, 50, 54, 51,
60 62, 68, 67, 62, 62, 65, 61, 66, 65, 62,
61 74, 78, 78, 77, 74, 74, 72, 74, 70, 78,
62 84, 83, 85, 86, 86, 89, 89, 85, 86, 86,
63 98, 97, 93, 91, 92, 92, 99, 93, 94, 92
64 ]);
65 chart1.addPlot("grid", {type: Grid, hMinorLines:true});
66 new Tooltip(chart1, "default");
67 new Magnify(chart1,"default");
68 chart1.setDir("rtl");
69 chart1.render();
70 chart2 = new Chart("chart2");
71 chart2.setTheme(orange);
72 chart2.addAxis("x", {fixLower: "minor", natural: true, stroke: "grey",
73 majorTick: {stroke: "black", length: 4}, minorTick: {stroke: "gray", length: 2}});
74 chart2.addAxis("y", {vertical: true, min: 0, max: 200, majorTickStep: 5, minorTickStep: 1, stroke: "grey",
75 majorTick: {stroke: "black", length: 4}, minorTick: {stroke: "gray", length: 2}});
76 chart2.addPlot("default", {type: StackedAreas });
77 chart2.addSeries("Series A", [
78 8, 7, 3, 2, 5, 7, 9, 10, 2, 10,
79 14, 16, 18, 13, 16, 15, 20, 19, 15, 12,
80 24, 20, 20, 26, 28, 26, 28, 29, 24, 29,
81 31, 35, 37, 31, 35, 37, 37, 36, 31, 30,
82 50, 49, 42, 46, 44, 40, 47, 43, 48, 47,
83 51, 52, 52, 51, 54, 57, 58, 50, 54, 51,
84 62, 68, 67, 62, 62, 65, 61, 66, 65, 62,
85 74, 78, 78, 77, 74, 74, 72, 74, 70, 78,
86 84, 83, 85, 86, 86, 89, 89, 85, 86, 86,
87 98, 97, 93, 91, 92, 92, 99, 93, 94, 92
88 ]);
89 chart2.addSeries("Series B", [
90 8, 7, 3, 2, 5, 7, 9, 10, 2, 10,
91 14, 16, 18, 13, 16, 15, 20, 19, 15, 12,
92 24, 20, 20, 26, 28, 26, 28, 29, 24, 29,
93 31, 35, 37, 31, 35, 37, 37, 36, 31, 30,
94 50, 49, 42, 46, 44, 40, 47, 43, 48, 47,
95 51, 52, 52, 51, 54, 57, 58, 50, 54, 51,
96 62, 68, 67, 62, 62, 65, 61, 66, 65, 62,
97 74, 78, 78, 77, 74, 74, 72, 74, 70, 78,
98 84, 83, 85, 86, 86, 89, 89, 85, 86, 86,
99 98, 97, 93, 91, 92, 92, 99, 93, 94, 92
100 ]);
101 chart2.setDir("rtl");
102 chart2.render();
103 });
104 });
105 </script>
106 </head>
107 <body class="tundra">
108 <h1>Axis Zoom Control</h1>
109 Try to drag the slider endpoints and the bar to zoom X axis of the chart.
110 <div style="margin:20px">
111 <div id="chart1" style="width: 800px; height: 400px;"></div>
112 <div id="chart2" style="width: 800px; height: 400px;"></div>
113 <div id="hrXAxisSlider"
114 discreteValues="21"
115 onChange="zoomXAxis"
116 intermediateChanges="false"
117 data-dojo-type="dojox.form.HorizontalRangeSlider"
118 showButtons="false"
119 style="width:748px;margin-left:40px"
120 value="0,100">
121 <ol data-dojo-type="dijit/form/HorizontalRuleLabels" container="topDecoration" style="height:1.2em;font-size:75%;color:gray;" count="11">
122 <li>0</li><li>10</li><li>20</li><li>30</li><li>40</li><li>50</li><li>60</li><li>70</li><li>80</li><li>90</li><li>100</li>
123 </ol>
124 <div data-dojo-type="dijit/form/HorizontalRule" container="topDecoration" count=11 style="height:10px;"></div>
125 </div>
126 </div>
127 <p>X Axis Lower Value:&nbsp;<input readonly id="minValue" size="10" value="0"/></p>
128 <p>X Axis Upper Value:&nbsp;<input readonly id="maxValue" size="10" value="100"/></p>
129 <p>That's all Folks!</p>
130 </body>
131 </html>