| 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 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
| 18 |
<title>Chart 2D rotated labels</title> |
| 19 |
<style type="text/css"> |
| 20 |
@import "../../../../dojo/resources/dojo.css"; |
| 21 |
@import "../../../../dijit/tests/css/dijitTests.css"; |
| 22 |
@import "../../../../dijit/themes/tundra/tundra.css"; |
| 23 |
</style> |
| 24 |
<script type="text/javascript" src="../../../../dojo/dojo.js" data-dojo-config="isDebug: true, parseOnLoad: true, has:{'dojo-bidi': true}"></script> |
| 25 |
<script type="text/javascript"> |
| 26 |
dojo.require("dojo.parser"); // scan page for widgets and instantiate them |
| 27 |
dojo.require("doh.runner"); |
| 28 |
|
| 29 |
dojo.require("dijit.form.Button"); |
| 30 |
dojo.require("dijit.form.NumberSpinner"); |
| 31 |
|
| 32 |
dojo.require("dojox.charting.Chart"); |
| 33 |
dojo.require("dojox.charting.axis2d.Default"); |
| 34 |
dojo.require("dojox.charting.plot2d.Default"); |
| 35 |
dojo.require("dojox.charting.themes.PrimaryColors"); |
| 36 |
|
| 37 |
var chart; |
| 38 |
|
| 39 |
makeObjects = function(){ |
| 40 |
chart = new dojox.charting.Chart("test1",{textDir:"rtl"}). |
| 41 |
setTheme(dojox.charting.themes.PrimaryColors). |
| 42 |
addPlot("default"). |
| 43 |
addSeries("Series A", [1, 3, 2, 5, 4]). |
| 44 |
addPlot("default2", {hAxis: "x2", vAxis: "y2"}). |
| 45 |
addSeries("Series B", [5, 3, 4, 1, 2], {plot: "default2"}); |
| 46 |
updateAxes(); |
| 47 |
|
| 48 |
}; |
| 49 |
|
| 50 |
dojo.addOnLoad(function(){ |
| 51 |
makeObjects(); |
| 52 |
doh.register("parse", function(){ |
| 53 |
dojo.parser.parse(); |
| 54 |
}); |
| 55 |
|
| 56 |
doh.register("test textDir", [ |
| 57 |
{ |
| 58 |
name: "initial textDir of chart", |
| 59 |
|
| 60 |
runTest: function(){ |
| 61 |
doh.is("rtl",chart.textDir, "direction of : chart"); |
| 62 |
} |
| 63 |
} |
| 64 |
]); |
| 65 |
|
| 66 |
doh.run(); |
| 67 |
|
| 68 |
}); |
| 69 |
|
| 70 |
updateAxes = function(){ |
| 71 |
var rotation = dijit.byId("rotation").get("value"); |
| 72 |
chart. |
| 73 |
addAxis("x", { |
| 74 |
htmlLabels: false, fixLower: "major", fixUpper: "major", min: 0, max: 6, |
| 75 |
labels: [ |
| 76 |
{value: 0, text: "\u05d0\u05e4\u05e1."}, |
| 77 |
{value: 1, text: "one."}, |
| 78 |
{value: 2, text: "two."}, |
| 79 |
{value: 3, text: "three."}, |
| 80 |
{value: 4, text: "four."}, |
| 81 |
{value: 5, text: "five."}, |
| 82 |
{value: 6, text: "My Name is: \u05e9\u05dc\u05d2\u05d9\u05d4."} |
| 83 |
], |
| 84 |
rotation: rotation |
| 85 |
}). |
| 86 |
addAxis("y", { |
| 87 |
htmlLabels: false, vertical: true, fixLower: "major", fixUpper: "major", natural: true, min: 0, max: 6, |
| 88 |
labels: [{value: 0, text: ""}, |
| 89 |
{value: 1, text: "\u05d9\u05e0\u05d5\u05d0\u05e8."}, {value: 2, text: "February."}, |
| 90 |
{value: 3, text: "March."}, {value: 4, text: "\u05d0\u05e4\u05e8\u05d9\u05dc."}, |
| 91 |
{value: 5, text: "May."}, {value: 6, text: "June."} |
| 92 |
], |
| 93 |
rotation: rotation |
| 94 |
}). |
| 95 |
addAxis("x2", { |
| 96 |
htmlLabels: false, fixLower: "major", fixUpper: "major", min: 0, max: 6, leftBottom: false, |
| 97 |
rotation: rotation |
| 98 |
}). |
| 99 |
addAxis("y2", { |
| 100 |
htmlLabels: false, vertical: true, fixLower: "major", fixUpper: "major", min: 0, max: 6, leftBottom: false, |
| 101 |
rotation: rotation |
| 102 |
}). |
| 103 |
setDir("rtl"). |
| 104 |
render(); |
| 105 |
} |
| 106 |
|
| 107 |
</script> |
| 108 |
</head> |
| 109 |
<body class="tundra"> |
| 110 |
<h1>Chart 2D rotated labels</h1> |
| 111 |
|
| 112 |
<p> |
| 113 |
Rotation: |
| 114 |
<input dojoType="dijit.form.NumberSpinner" id="rotation" value="0" constraints="{min: 0, max: 360, fractional: false}" style="width: 8em;"> |
| 115 |
|
| 116 |
<button dojoType="dijit.form.Button" onClick="updateAxes()">Apply</button> |
| 117 |
</p> |
| 118 |
<div id="test1" style="width: 600px; height: 400px;"></div> |
| 119 |
<p>That's all Folks!</p> |
| 120 |
</body> |
| 121 |
</html> |