| 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 Indicator</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 |
body { -ms-touch-action: none; } |
| 23 |
</style> |
| 24 |
<script type="text/javascript" src="../../../dojo/dojo.js" |
| 25 |
data-dojo-config="isDebug: true, parseOnLoad: true"></script> |
| 26 |
<script type="text/javascript"> |
| 27 |
dojo.require("dojo.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 |
dojo.require("dojox.charting.action2d.TouchIndicator"); |
| 34 |
|
| 35 |
var chart; |
| 36 |
makeObjects = function() { |
| 37 |
chart = new dojox.charting.Chart("chart"); |
| 38 |
chart.addAxis("x", { |
| 39 |
type : "Default", |
| 40 |
font: "normal normal normal 14pt Tahoma", |
| 41 |
fixLower : "minor", |
| 42 |
natural : true, |
| 43 |
stroke : "gray", |
| 44 |
majorTick : { |
| 45 |
color : "red", |
| 46 |
length : 4 |
| 47 |
}, |
| 48 |
minorTick : { |
| 49 |
color : "blue", |
| 50 |
length : 2 |
| 51 |
} |
| 52 |
}); |
| 53 |
chart.addAxis("y", { |
| 54 |
vertical : true, |
| 55 |
font: "normal normal normal 14pt Tahoma", |
| 56 |
min : 0, |
| 57 |
max : 100, |
| 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 |
chart.addPlot("default", { |
| 71 |
type : "Default", |
| 72 |
markers : false, |
| 73 |
areas: true |
| 74 |
}); |
| 75 |
chart.addSeries("Series A", [ 8, 7, 3, 2, 5, 7, 9, 10, 2, 10, 14, 16, |
| 76 |
29, 13, 16, 15, 20, 19, 15, 12, 24, 20, 20, 26, 28, 26, 28, 14, |
| 77 |
24, 29, 31, 35, 37, 31, 35, 37, 37, 36, 31, 30, 50, 49, 42, 46, |
| 78 |
44, 40, 47, 43, 48, 47, 51, 52, 52, 51, 54, 57, 58, 50, 54, 51, |
| 79 |
74, 68, 67, 62, 62, 65, 61, 66, 65, 62, 74, 78, 78, 77, 74, 62, |
| 80 |
72, 74, 70, 78, 84, 83, 85, 86, 86, 89, 89, 85, 86, 86, 98, 73, |
| 81 |
93, 91, 92, 92, 99, 93, 94, 92 ]); |
| 82 |
new dojox.charting.action2d.TouchZoomAndPan(chart, "default", |
| 83 |
{axis: "x", enableScroll : false, enableZoom : false}); |
| 84 |
new dojox.charting.action2d.TouchIndicator(chart, "default", |
| 85 |
{ series: "Series A", |
| 86 |
dualIndicator : true, font: "normal normal bold 16pt Tahoma", fillFunc: function(v1, v2){ |
| 87 |
if(v2){ |
| 88 |
return v2.y>v1.y?"green":"red"; |
| 89 |
}else{ |
| 90 |
return "white"; |
| 91 |
} |
| 92 |
} |
| 93 |
}); |
| 94 |
chart.render(); |
| 95 |
}; |
| 96 |
|
| 97 |
dojo.addOnLoad(makeObjects); |
| 98 |
</script> |
| 99 |
</head> |
| 100 |
<body class="tundra" style="height: 100%; width: 100%"> |
| 101 |
<div id="chart" style="width: 100%; height: 100%;"></div> |
| 102 |
</body> |
| 103 |
</html> |