| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
<![if gte IE 9]> |
| 13 |
<!DOCTYPE HTML> |
| 14 |
<html lang="en"> |
| 15 |
<head> |
| 16 |
<![endif]> |
| 17 |
<title>Touch Zoom And Pan</title> |
| 18 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 19 |
<meta name="viewport" content="user-scalable=no, width=device-width, height=device-height" /> |
| 20 |
<style type="text/css"> |
| 21 |
@import "../../../dojo/resources/dojo.css"; |
| 22 |
@import "../../../dijit/themes/tundra/tundra.css"; |
| 23 |
body { -ms-touch-action: none; } |
| 24 |
</style> |
| 25 |
<script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="isDebug: true, parseOnLoad: true"></script> |
| 26 |
<script type="text/javascript"> |
| 27 |
dojo.require("dojox.mobile.parser"); |
| 28 |
|
| 29 |
dojo.require("dojox.charting.Chart"); |
| 30 |
dojo.require("dojox.charting.axis2d.Default"); |
| 31 |
dojo.require("dojox.charting.plot2d.Lines"); |
| 32 |
dojo.require("dojox.charting.action2d.TouchZoomAndPan"); |
| 33 |
|
| 34 |
var chart; |
| 35 |
makeObjects = function(){ |
| 36 |
chart = new dojox.charting.Chart("chart"); |
| 37 |
chart.addAxis("x", {type : "Default", fixLower: "minor", natural: true, stroke: "gray", enableCache: true, |
| 38 |
htmlLabels: false, majorTick: {color: "red", length: 4}, minorTick: {color: "blue", length: 2}}); |
| 39 |
chart.addAxis("y", {vertical: true, min: 0, max: 100, majorTickStep: 10, minorTickStep: 5, stroke: "gray", |
| 40 |
majorTick: {stroke: "black", length: 4}, minorTick: {stroke: "gray", length: 2}}); |
| 41 |
chart.addPlot("default", {type: "Default",markers: false, areas: true }); |
| 42 |
chart.addSeries("Series A", [ |
| 43 |
8, 7, 3, 2, 5, 7, 9, 10, 2, 10, |
| 44 |
14, 16, 18, 13, 16, 15, 20, 19, 15, 12, |
| 45 |
24, 20, 20, 26, 28, 26, 28, 29, 24, 29, |
| 46 |
31, 35, 37, 31, 35, 37, 37, 36, 31, 30, |
| 47 |
50, 49, 42, 46, 44, 40, 47, 43, 48, 47, |
| 48 |
51, 52, 52, 51, 54, 57, 58, 50, 54, 51, |
| 49 |
62, 68, 67, 62, 62, 65, 61, 66, 65, 62, |
| 50 |
74, 78, 78, 77, 74, 74, 72, 74, 70, 78, |
| 51 |
84, 83, 85, 86, 86, 89, 89, 85, 86, 86, |
| 52 |
98, 97, 93, 91, 92, 92, 99, 93, 94, 92 |
| 53 |
]); |
| 54 |
new dojox.charting.action2d.TouchZoomAndPan(chart, "default", { axis: "x" }); |
| 55 |
chart.render(); |
| 56 |
chart.zoomIn("x", [40, 60]); |
| 57 |
}; |
| 58 |
dojo.addOnLoad(makeObjects); |
| 59 |
</script> |
| 60 |
</head> |
| 61 |
<body class="tundra" style="height:100%;width:100%"> |
| 62 |
<div id="chart" style="width: 100%; height: 100%;"></div> |
| 63 |
</body> |
| 64 |
</html> |