| 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>Event 2D</title> |
| 19 |
<style type="text/css"> |
| 20 |
@import "../../../../dojo/resources/dojo.css"; |
| 21 |
@import "../../../../dijit/tests/css/dijitTests.css"; |
| 22 |
</style> |
| 23 |
|
| 24 |
<link rel="stylesheet" href="../../../../dijit/themes/claro/claro.css"> |
| 25 |
<style> |
| 26 |
.dojoxLegendNode {border: 1px solid #ccc; margin: 5px 10px 5px 10px; padding: 3px} |
| 27 |
.dojoxLegendText {vertical-align: text-top; padding-right: 10px} |
| 28 |
</style> |
| 29 |
<script type="text/javascript" src="../../../../dojo/dojo.js" data-dojo-config="isDebug: true, has:{'dojo-bidi': true}"></script> |
| 30 |
<script type="text/javascript"> |
| 31 |
dojo.require("dojo.parser"); |
| 32 |
dojo.require("doh.runner"); |
| 33 |
|
| 34 |
dojo.require("dojox.charting.Chart"); |
| 35 |
dojo.require("dojox.charting.axis2d.Default"); |
| 36 |
dojo.require("dojox.charting.plot2d.Default"); |
| 37 |
dojo.require("dojox.charting.plot2d.Columns"); |
| 38 |
dojo.require("dojox.charting.plot2d.ClusteredColumns"); |
| 39 |
dojo.require("dojox.charting.plot2d.Bars"); |
| 40 |
dojo.require("dojox.charting.plot2d.Bubble"); |
| 41 |
dojo.require("dojox.charting.plot2d.Grid"); |
| 42 |
dojo.require("dojox.charting.plot2d.Pie"); |
| 43 |
|
| 44 |
dojo.require("dojox.charting.themes.PlotKit.green"); |
| 45 |
|
| 46 |
dojo.require("dojox.charting.action2d.Highlight"); |
| 47 |
dojo.require("dojox.charting.action2d.Magnify"); |
| 48 |
dojo.require("dojox.charting.action2d.MoveSlice"); |
| 49 |
dojo.require("dojox.charting.action2d.Shake"); |
| 50 |
dojo.require("dojox.charting.action2d.Tooltip"); |
| 51 |
|
| 52 |
dojo.require("dojox.charting.widget.Legend"); |
| 53 |
|
| 54 |
dojo.require("dojo.colors"); |
| 55 |
dojo.require("dojo.fx.easing"); |
| 56 |
|
| 57 |
var dc = dojox.charting; |
| 58 |
|
| 59 |
var dur = 450; |
| 60 |
|
| 61 |
var chart1, legend1, chart3, legend3, chart6, legend6, chart9, legend9, |
| 62 |
chart10, legend10; |
| 63 |
|
| 64 |
makeObjects = function(){ |
| 65 |
chart1 = new dc.Chart("test1",{textDir:"rtl", title:"\u05d6\u05d4\u05d5\u0020\u05ea\u05e8\u05e9\u05d9\u05dd\u0020\u05de\u05d4\u05de\u05dd."}); |
| 66 |
chart1.setTheme(dc.themes.PlotKit.green); |
| 67 |
chart1.addPlot("default", {type: "Default", lines: true, markers: true, tension:2}); |
| 68 |
chart1.addAxis("x", {min: 0, max: 6, majorTick: {stroke: "black", length: 3}, minorTick: {stroke: "gray", length: 3} |
| 69 |
, labels: [ |
| 70 |
//{value: 0, text: "zero"}, |
| 71 |
{value: 2, text: "\u05e9\u05ea\u05d9\u05d9\u05dd."}, |
| 72 |
{value: 4, text: "four."} |
| 73 |
] |
| 74 |
, title:"\u05e6\u05d9\u05e8 x." |
| 75 |
, titleGap: 20 |
| 76 |
, titleFont: "normal normal normal 10pt Arial" |
| 77 |
, titleOrientation: "away" |
| 78 |
}); |
| 79 |
chart1.addAxis("y", {vertical: true, min: 0, max: 10, majorTick: {stroke: "black", length: 3}, minorTick: {stroke: "gray", length: 3}, title:"\u05e6\u05d9\u05e8 y."}); |
| 80 |
chart1.addSeries("\u05e1\u05d3\u05e8\u05d4\u0020\u05d0\u0027.", [{x: 0.5,value:"Name." ,y: 5, tooltip:"My name is \u05e8\u05d1\u05e7\u05d4\u0020\u05d1\u05ea\u0020\u05de\u05e9\u05d4."}, {x: 1.5, y: 1.5, tooltip:"\u05e7\u05d5\u05e8\u05d0\u05d9\u05dd\u0020\u05dc\u05d9 Dvora."}, {x: 2, y: 9, tooltip:"My name is \u05e8\u05d1\u05e7\u05d4\u0020\u05d1\u05ea\u0020\u05de\u05e9\u05d4."}, {x: 5, y: 0.3, tooltip:"\u05e7\u05d5\u05e8\u05d0\u05d9\u05dd\u0020\u05dc\u05d9 Dvora."}]); |
| 81 |
chart1.addSeries("Series B.", [{x: 0.3, y: 8, tooltip:"My name is \u05e8\u05d1\u05e7\u05d4\u0020\u05d1\u05ea\u0020\u05de\u05e9\u05d4."}, {x: 4, y: 6, tooltip: "Custom tooltip"}, {x: 5.5, y: 2, tooltip:"\u05e7\u05d5\u05e8\u05d0\u05d9\u05dd\u0020\u05dc\u05d9 Dvora."}]); |
| 82 |
var anim1a = new dc.action2d.Magnify(chart1, "default"); |
| 83 |
var anim1b = new dc.action2d.Tooltip(chart1, "default"); |
| 84 |
chart1.setDir("rtl"); |
| 85 |
chart1.render(); |
| 86 |
legend1 = new dojox.charting.widget.Legend({chart: chart1, horizontal: false}, "legend1"); |
| 87 |
|
| 88 |
chart3 = new dc.Chart("test3",{textDir:"auto", title:"\u05d6\u05d4\u05d5\u0020\u05ea\u05e8\u05e9\u05d9\u05dd\u0020\u05de\u05d4\u05de\u05dd."}); |
| 89 |
chart3.setTheme(dc.themes.PlotKit.green); |
| 90 |
chart3.addAxis("y", {vertical: true, fixLower: "major", fixUpper: "major", |
| 91 |
labels: [ |
| 92 |
{value: 1, text: "one."}, |
| 93 |
{value: 2, text: "\u05e9\u05ea\u05d9\u05d9\u05dd."}, |
| 94 |
{value: 4, text: "\u05d4\u05ea\u05d7\u05dc\u05d4 end."} |
| 95 |
] |
| 96 |
}); |
| 97 |
chart3.addPlot("default", {type: "Columns", gap: 2, htmlLabels:false}); |
| 98 |
chart3.addSeries("\u05e1\u05d3\u05e8\u05d4\u0020\u05d0\u0027.", [1, 2, 3, 4, 5], {stroke: {color: "black"}, fill: "red"}); |
| 99 |
chart3.addSeries("Series B.", [{y:5, tooltip:"My name is \u05e8\u05d1\u05e7\u05d4\u0020\u05d1\u05ea\u0020\u05de\u05e9\u05d4."}, {y:4, tooltip:"My name is \u05e8\u05d1\u05e7\u05d4\u0020\u05d1\u05ea\u0020\u05de\u05e9\u05d4."}, {y:3, tooltip:"My name is \u05e8\u05d1\u05e7\u05d4\u0020\u05d1\u05ea\u0020\u05de\u05e9\u05d4."}, {y:2, tooltip:"My name is \u05e8\u05d1\u05e7\u05d4\u0020\u05d1\u05ea\u0020\u05de\u05e9\u05d4."}, {y:1, tooltip:"My name is \u05e8\u05d1\u05e7\u05d4\u0020\u05d1\u05ea\u0020\u05de\u05e9\u05d4."}], {stroke: {color: "black"}, fill: "blue"}); |
| 100 |
var anim3a = new dc.action2d.Highlight(chart3, "default"); |
| 101 |
var anim3b = new dc.action2d.Tooltip(chart3, "default"); |
| 102 |
chart3.setDir("rtl"); |
| 103 |
chart3.render(); |
| 104 |
legend3 = new dojox.charting.widget.Legend({chart: chart3, horizontal: false}, "legend3"); |
| 105 |
|
| 106 |
chart6 = new dc.Chart("test6",{title:"\u05d6\u05d4\u05d5\u0020\u05ea\u05e8\u05e9\u05d9\u05dd\u0020\u05de\u05d4\u05de\u05dd.",textDir:"auto"}); |
| 107 |
chart6.setTheme(dc.themes.PlotKit.green); |
| 108 |
chart6.addAxis("x",{ |
| 109 |
labels: [ |
| 110 |
//{value: 0, text: "zero"}, |
| 111 |
{value: 2, text: "\u05e9\u05ea\u05d9\u05d9\u05dd."}, |
| 112 |
{value: 4, text: "four."} |
| 113 |
] |
| 114 |
, title:"\u05e6\u05d9\u05e8 x." |
| 115 |
, titleGap: 20 |
| 116 |
, titleFont: "normal normal normal 10pt Arial" |
| 117 |
, titleOrientation: "away" |
| 118 |
}); |
| 119 |
chart6.addAxis("y", {vertical: true, |
| 120 |
labels: [ |
| 121 |
{value: 1, text: "one."}, |
| 122 |
{value: 2, text: "\u05e9\u05ea\u05d9\u05d9\u05dd."}, |
| 123 |
{value: 4, text: "\u05d4\u05ea\u05d7\u05dc\u05d4 end."} |
| 124 |
], |
| 125 |
title:"\u05e6\u05d9\u05e8 y." |
| 126 |
|
| 127 |
|
| 128 |
}); |
| 129 |
chart6.addPlot("default", {type: "ClusteredColumns", gap: 10}); |
| 130 |
chart6.addPlot("grid", {type: "Grid"}); |
| 131 |
chart6.addSeries("\u05e1\u05d3\u05e8\u05d4\u0020\u05d0\u0027.", [{y:2, tooltip:"I work at \u05d9\u05d1\u05de in Israel."}, {y:1, tooltip:"I work at \u05d9\u05d1\u05de in Israel."}, {y:0.5, tooltip:"I work at \u05d9\u05d1\u05de in Israel."},{y: -1, tooltip:"I work at \u05d9\u05d1\u05de in Israel."},{y: -2,tooltip:"\u05d0\u05e0\u05d9\u0020\u05e2\u05d5\u05d1\u05d3\u05ea\u0020\u05d1\u002d IBM \u05d9\u05e9\u05e8\u05d0\u05dc."}], {stroke: {color: "black"}, fill: "red"}); |
| 132 |
chart6.addSeries("Series B.", [{y: -2,tooltip:"\u05d0\u05e0\u05d9\u0020\u05e2\u05d5\u05d1\u05d3\u05ea\u0020\u05d1\u002d IBM \u05d9\u05e9\u05e8\u05d0\u05dc."}, {y:-1,tooltip:"\u05d0\u05e0\u05d9\u0020\u05e2\u05d5\u05d1\u05d3\u05ea\u0020\u05d1\u002d IBM \u05d9\u05e9\u05e8\u05d0\u05dc."}, {y:-0.5,tooltip:"\u05d0\u05e0\u05d9\u0020\u05e2\u05d5\u05d1\u05d3\u05ea\u0020\u05d1\u002d IBM \u05d9\u05e9\u05e8\u05d0\u05dc."}, {y:1,tooltip:"\u05d0\u05e0\u05d9\u0020\u05e2\u05d5\u05d1\u05d3\u05ea\u0020\u05d1\u002d IBM \u05d9\u05e9\u05e8\u05d0\u05dc."}, {y:2,tooltip:"\u05d0\u05e0\u05d9\u0020\u05e2\u05d5\u05d1\u05d3\u05ea\u0020\u05d1\u002d IBM \u05d9\u05e9\u05e8\u05d0\u05dc."}], {stroke: {color: "black"}, fill: "blue"}); |
| 133 |
chart6.addSeries("Series C", [1, 0.5, -1, -2, -3], {stroke: {color: "black"}, fill: "green"}); |
| 134 |
var anim6a = new dc.action2d.Highlight(chart6, "default", { |
| 135 |
duration: dur, |
| 136 |
easing: dojo.fx.easing.sineOut |
| 137 |
}); |
| 138 |
var anim6b = new dc.action2d.Shake(chart6, "default"); |
| 139 |
var anim6c = new dc.action2d.Tooltip(chart6, "default"); |
| 140 |
chart6.setDir("rtl"); |
| 141 |
chart6.render(); |
| 142 |
legend6 = new dojox.charting.widget.Legend({chart: chart6}, "legend6"); |
| 143 |
|
| 144 |
chart9 = new dc.Chart("test9", {textDir:"", title:"This is some \u05ea\u05e8\u05e9\u05d9\u05dd."}); |
| 145 |
chart9.setTheme(dc.themes.PlotKit.green); |
| 146 |
chart9.addPlot("default", {type: "Bubble", shadows: {dx: 2, dy: 2, dw: 2}}); |
| 147 |
chart9.addAxis("x", {min: 0, max: 6, majorTick: {stroke: "black", length: 3}, minorTick: {stroke: "gray", length: 3}, |
| 148 |
labels: [ |
| 149 |
{value: 1, text: "one."}, |
| 150 |
{value: 2, text: "\u05e9\u05ea\u05d9\u05d9\u05dd."}, |
| 151 |
{value: 4, text: "\u05d4\u05ea\u05d7\u05dc\u05d4 end."} |
| 152 |
] }); |
| 153 |
chart9.addAxis("y", {vertical: true, min: 0, max: 10, majorTick: {stroke: "black", length: 3}, minorTick: {stroke: "gray", length: 3}, |
| 154 |
labels: [ |
| 155 |
{value: 1, text: "one."}, |
| 156 |
{value: 2, text: "\u05e9\u05ea\u05d9\u05d9\u05dd."}, |
| 157 |
{value: 4, text: "\u05d4\u05ea\u05d7\u05dc\u05d4 end."} |
| 158 |
] }); |
| 159 |
chart9.addSeries("\u05e1\u05d3\u05e8\u05d4\u0020\u05d0\u0027.", [{x: 0.5, y: 5, size: 1.4}, {x: 1.5, y: 1.5, size:4.5}, {x: 2, y: 9, size:1.5}, {x: 5, y: 0.3, size:0.8}], |
| 160 |
{stroke: {color: "black"}, fill: "red"}); |
| 161 |
chart9.addSeries("Series B.", [{x: 0.3, y: 8, size: 2.5, tooltip:"My name is \u05e8\u05d1\u05e7\u05d4\u0020\u05d1\u05ea\u0020\u05de\u05e9\u05d4."}, {x: 4, y: 6, size:1.1, tooltip:"\u05d0\u05e0\u05d9\u0020\u05e2\u05d5\u05d1\u05d3\u05ea\u0020\u05d1\u002d IBM \u05d9\u05e9\u05e8\u05d0\u05dc."}, {x: 5.5, y: 2, size: 3.2, tooltip:"I work at \u05d9\u05d1\u05de in Israel."}], |
| 162 |
{stroke: {color: "black"}, fill: "blue"}); |
| 163 |
var anim9a = new dc.action2d.Magnify(chart9, "default", { |
| 164 |
scale: 1.1 |
| 165 |
}); |
| 166 |
var anim9b = new dc.action2d.Highlight(chart9, "default"); |
| 167 |
var anim9c = new dc.action2d.Tooltip(chart9, "default"); |
| 168 |
chart9.setDir("rtl"); |
| 169 |
chart9.render(); |
| 170 |
legend9 = new dojox.charting.widget.Legend({chart: chart9, horizontal: false}, "legend9"); |
| 171 |
|
| 172 |
chart10 = new dc.Chart("test10", {title:"Pie.",textDir:"rtl"}); |
| 173 |
chart10.setTheme(dc.themes.PlotKit.green); |
| 174 |
chart10.addPlot("default", { |
| 175 |
type: "Pie", |
| 176 |
font: "normal normal 11pt Tahoma", |
| 177 |
fontColor: "black", |
| 178 |
labelOffset: -30, |
| 179 |
radius: 150, |
| 180 |
startAngle: 45 |
| 181 |
}); |
| 182 |
chart10.addSeries("\u05e1\u05d3\u05e8\u05d4\u0020\u05d0\u0027.", [ |
| 183 |
{y: 4, text: "My color is - \u05d0\u05d3\u05d5\u05dd.", color: "red", stroke: "black", tooltip: "\u05d4\u05e6\u05d1\u05e2\u0020\u05e9\u05dc\u05d9\u0020\u05d4\u05d5\u05d0: red, \u05d5\u05d0\u05e0\u05d9\u0020\u05ea\u05d5\u05e4\u05e1 50% \u05de\u05d4\u05e2\u05d5\u05d2\u05d4!!!"}, |
| 184 |
{y: 2, text: "\u05d4\u05e6\u05d1\u05e2\u0020\u05e9\u05dc\u05d9\u0020\u05d4\u05d5\u05d0: green.", color: "green", stroke: "black", tooltip: "Green is \u05d4\u05e6\u05d1\u05e2\u0020\u05d4\u05d0\u05d4\u05d5\u05d1\u0020\u05e2\u05dc\u05d9, because that's the color of my team!!"}, |
| 185 |
{y: 1, text: "Blue.", color: "blue", stroke: "black", tooltip: "I am feeling Blue!"}, |
| 186 |
{y: 1, text: "Other.", color: "white", stroke: "black", tooltip: "Mighty <strong>\u05d7\u05d6\u05e7</strong><br>With two lines!"} |
| 187 |
]); |
| 188 |
var anim10a = new dc.action2d.MoveSlice(chart10, "default"); |
| 189 |
var anim10b = new dc.action2d.Highlight(chart10, "default"); |
| 190 |
var anim10c = new dc.action2d.Tooltip(chart10, "default"); |
| 191 |
chart10.setDir("rtl"); |
| 192 |
chart10.render(); |
| 193 |
legend10 = new dojox.charting.widget.Legend({chart: chart10}, "legend10"); |
| 194 |
}; |
| 195 |
|
| 196 |
dojo.addOnLoad(function(){ |
| 197 |
makeObjects(); |
| 198 |
|
| 199 |
doh.register("parse", function(){ |
| 200 |
dojo.parser.parse(); |
| 201 |
}); |
| 202 |
|
| 203 |
doh.register("test textDir", [ |
| 204 |
{ |
| 205 |
name: "initial.", |
| 206 |
|
| 207 |
runTest: function(){ |
| 208 |
doh.is("rtl", chart1.textDir, "textDir of : chart1"); |
| 209 |
doh.is("rtl", legend1.textDir, "textDir of : legend1"); |
| 210 |
|
| 211 |
doh.is("auto", chart3.textDir, "textDir of : chart3"); |
| 212 |
doh.is("auto", legend3.textDir, "textDir of : legend3"); |
| 213 |
|
| 214 |
doh.is("auto", chart6.textDir, "textDir of : chart6"); |
| 215 |
doh.is("auto", legend6.textDir, "textDir of : legend6"); |
| 216 |
|
| 217 |
doh.is("ltr", chart9.textDir, "textDir of : chart9"); |
| 218 |
doh.is("ltr", legend9.textDir, "textDir of : legend9"); |
| 219 |
|
| 220 |
doh.is("rtl", chart10.textDir, "textDir of : chart10"); |
| 221 |
doh.is("rtl", legend10.textDir, "textDir of : legend10"); |
| 222 |
} |
| 223 |
} |
| 224 |
]); |
| 225 |
doh.run(); |
| 226 |
}); |
| 227 |
|
| 228 |
</script> |
| 229 |
</head> |
| 230 |
<body class="claro"> |
| 231 |
<h1>Event 2D</h1> |
| 232 |
|
| 233 |
<p>Hover over markers, bars, columns, slices, and so on.</p> |
| 234 |
<h2>1: textDir = "rtl"</h2> |
| 235 |
<div id="test1" style="width: 500px; height: 300px;"></div> |
| 236 |
<div id="legend1"></div> |
| 237 |
<h2>2: textDir = "auto"</h2> |
| 238 |
<div id="test3" style="width: 500px; height: 300px;"></div> |
| 239 |
<div id="legend3"></div> |
| 240 |
<h2>3: textDir = "auto"</h2> |
| 241 |
<div id="test6" style="width: 500px; height: 300px;"></div> |
| 242 |
<div id="legend6"></div> |
| 243 |
<h2>4: textDir inherited from UI</h2> |
| 244 |
<div id="test9" style="width: 500px; height: 300px;"></div> |
| 245 |
<div id="legend9"></div> |
| 246 |
<h2>5: textDir = "rtl"</h2> |
| 247 |
<div id="test10" style="width: 500px; height: 500px;"></div> |
| 248 |
<div id="legend10"></div> |
| 249 |
<p>That's all Folks!</p> |
| 250 |
</body> |
| 251 |
</html> |