| 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>Pie 2D</title> |
| 19 |
<style type="text/css"> |
| 20 |
@import "../../../../dojo/resources/dojo.css"; |
| 21 |
@import "../../../../dijit/tests/css/dijitTests.css"; |
| 22 |
</style> |
| 23 |
<script type="text/javascript" src="../../../../dojo/dojo.js" data-dojo-config="isDebug: true, parseOnLoad:true, has:{'dojo-bidi': true}"></script> |
| 24 |
<script type="text/javascript"> |
| 25 |
dojo.require("dojo.parser"); |
| 26 |
dojo.require("doh.runner"); |
| 27 |
|
| 28 |
dojo.require("dojox.charting.Chart"); |
| 29 |
dojo.require("dojox.charting.plot2d.Pie"); |
| 30 |
dojo.require("dojox.charting.themes.PlotKit.blue"); |
| 31 |
dojo.require("dojox.charting.themes.PlotKit.green"); |
| 32 |
dojo.require("dojox.charting.themes.PlotKit.red"); |
| 33 |
dojo.require("dojox.charting.themes.Adobebricks"); |
| 34 |
dojo.require("dojox.charting.themes.Algae"); |
| 35 |
dojo.require("dojox.charting.action2d.Tooltip"); |
| 36 |
|
| 37 |
var chart1, chart2, chart8; |
| 38 |
makeObjects = function(){ |
| 39 |
chart1 = new dojox.charting.Chart("test1", {textDir:"rtl"}); |
| 40 |
chart1.setTheme(dojox.charting.themes.PlotKit.blue); |
| 41 |
chart1.addPlot("default", { |
| 42 |
type: "Pie", |
| 43 |
font: "normal normal bold 12pt Tahoma", |
| 44 |
fontColor: "black", |
| 45 |
labelOffset: 40, |
| 46 |
htmlLabels: false |
| 47 |
}); |
| 48 |
chart1.addSeries("Series A", [{y: 4, text: "\u05e9\u05dc\u05d5\u05dd big world!"}, {y: 2, text: "Hello \u05e2\u05d5\u05dc\u05dd\u0020\u05d2\u05d3\u05d5\u05dc!"}, {y: 1, text: "Blue."}, {y: 1, text: "Other..."}]); |
| 49 |
new dojox.charting.action2d.Tooltip(chart1); |
| 50 |
|
| 51 |
chart1.setDir("rtl"); |
| 52 |
chart1.render(); |
| 53 |
|
| 54 |
chart2 = new dojox.charting.Chart("test2", {textDir:"auto"}); |
| 55 |
chart2.setTheme(dojox.charting.themes.PlotKit.blue); |
| 56 |
chart2.addPlot("default", { |
| 57 |
type: "Pie", |
| 58 |
font: "normal normal bold 12pt Tahoma", |
| 59 |
fontColor: "black", |
| 60 |
labelOffset: -25, |
| 61 |
precision: 0, |
| 62 |
radius: 100, |
| 63 |
htmlLabels: false |
| 64 |
}); |
| 65 |
chart2.addSeries("Series A", [{y: 4, text: "\u05e9\u05dc\u05d5\u05dd!"}, {y: 2, text: "Hello!"}, {y: 1, text: "Blue!"}, {y: 1, text: "Other!"}]); |
| 66 |
chart2.setDir("rtl"); |
| 67 |
chart2.render(); |
| 68 |
|
| 69 |
|
| 70 |
chart8 = new dojox.charting.Chart("test8"); |
| 71 |
chart8.setTheme(dojox.charting.themes.Algae); |
| 72 |
chart8.addPlot("default", { |
| 73 |
type: "Pie", |
| 74 |
font: "normal normal bold 12pt Tahoma", |
| 75 |
fontColor: "white", |
| 76 |
radius: 80, |
| 77 |
htmlLabels: false |
| 78 |
}); |
| 79 |
chart8.addSeries("Series A", [ |
| 80 |
{y: -1, text: "Red", color: "red"}, |
| 81 |
{y: 5, text: "\u05e9\u05dc\u05d5\u05dd!", color: "green"}, |
| 82 |
{y: 0, text: "Blue", color: "blue"}, |
| 83 |
{y: 0, text: "Other", color: "white", fontColor: "black"} |
| 84 |
]); |
| 85 |
chart8.setDir("rtl"); |
| 86 |
chart8.render(); |
| 87 |
}; |
| 88 |
|
| 89 |
dojo.addOnLoad(function(){ |
| 90 |
makeObjects(); |
| 91 |
|
| 92 |
doh.register("parse", function(){ |
| 93 |
dojo.parser.parse(); |
| 94 |
}); |
| 95 |
|
| 96 |
doh.register("test textDir", [ |
| 97 |
{ |
| 98 |
name: "Pies textDir", |
| 99 |
|
| 100 |
runTest: function(){ |
| 101 |
doh.is("rtl", chart1.textDir, "chart1: internal labels"); |
| 102 |
doh.is("auto", chart2.textDir, "chart2: external labels"); |
| 103 |
doh.is("ltr", chart8.textDir, "chart8: Degenerated pie, textDir inherited"); |
| 104 |
} |
| 105 |
} |
| 106 |
]); |
| 107 |
|
| 108 |
doh.run(); |
| 109 |
}); |
| 110 |
</script> |
| 111 |
</head> |
| 112 |
<body> |
| 113 |
<h1>Pie 2D</h1> |
| 114 |
<table border="1"><tr> |
| 115 |
<td><p>1: Pie with internal labels.</p> |
| 116 |
<div id="test1" style="width: 300px; height: 300px;"></div></td> |
| 117 |
<td><p>2: Pie with external labels.</p> |
| 118 |
<div id="test2" style="width: 300px; height: 300px;"></div></td> |
| 119 |
<td><p>3: Degenerated pie with 1 positive elements (out of 5).</p> |
| 120 |
<div id="test8" style="width: 200px; height: 200px;"></div></td> |
| 121 |
</tr></table> |
| 122 |
<p>That's all Folks!</p> |
| 123 |
</body> |
| 124 |
</html> |