| 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 |
<meta http-equiv="X-UA-Compatible" content="chrome=1"/> |
| 19 |
<title>DojoX Charting Theme Previewer</title> |
| 20 |
<style type="text/css"> |
| 21 |
@import "../../../dojo/resources/dojo.css"; |
| 22 |
body { |
| 23 |
padding: 1.5em; |
| 24 |
} |
| 25 |
div.container { |
| 26 |
position: relative; |
| 27 |
width: 180px; |
| 28 |
height: 200px; |
| 29 |
float: left; |
| 30 |
border: 1px solid #ccc; |
| 31 |
margin: 12px; |
| 32 |
} |
| 33 |
div.container div.chart { |
| 34 |
width: 180px; |
| 35 |
height: 180px; |
| 36 |
} |
| 37 |
div.container div.title { |
| 38 |
position: absolute; |
| 39 |
bottom: 4px; |
| 40 |
font-size: 11px; |
| 41 |
width: 180px; |
| 42 |
text-align: center; |
| 43 |
} |
| 44 |
div.container div.title a { text-decoration: none; } |
| 45 |
div.container div.title a:hover { text-decoration: underline; } |
| 46 |
</style> |
| 47 |
<script src="../../../dojo/dojo.js" data-dojo-config="isDebug: false, async: true, gfxRenderer: 'svg,silverlight,vml,canvas'"></script> |
| 48 |
<script type="text/javascript"> |
| 49 |
require(["dojo/_base/array", "dojo/dom-construct", "dojo/ready", |
| 50 |
"dojox/charting/Chart", "dojox/charting/plot2d/Pie", "dojox/gfx/_base"], |
| 51 |
function(arr, domConstruct, ready, Chart, Pie, gfx){ |
| 52 |
|
| 53 |
var themes = [ |
| 54 |
"dojox/charting/themes/Julie", "dojox/charting/themes/ThreeD", "dojox/charting/themes/Chris", |
| 55 |
"dojox/charting/themes/Tom", "dojox/charting/themes/Claro", "dojox/charting/themes/PrimaryColors", |
| 56 |
"dojox/charting/themes/Electric", "dojox/charting/themes/Charged", "dojox/charting/themes/Renkoo", |
| 57 |
"dojox/charting/themes/Adobebricks", "dojox/charting/themes/Algae", "dojox/charting/themes/Bahamation", |
| 58 |
"dojox/charting/themes/BlueDusk", "dojox/charting/themes/CubanShirts", "dojox/charting/themes/Desert", |
| 59 |
"dojox/charting/themes/Distinctive", "dojox/charting/themes/Dollar", "dojox/charting/themes/Grasshopper", |
| 60 |
"dojox/charting/themes/Grasslands", "dojox/charting/themes/GreySkies", "dojox/charting/themes/Harmony", |
| 61 |
"dojox/charting/themes/IndigoNation", "dojox/charting/themes/Ireland", "dojox/charting/themes/MiamiNice", |
| 62 |
"dojox/charting/themes/Minty", "dojox/charting/themes/PurpleRain", "dojox/charting/themes/RoyalPurples", |
| 63 |
"dojox/charting/themes/SageToLime", "dojox/charting/themes/Shrooms", "dojox/charting/themes/Tufte", |
| 64 |
"dojox/charting/themes/WatersEdge", "dojox/charting/themes/Wetland", "dojox/charting/themes/PlotKit/blue", |
| 65 |
"dojox/charting/themes/PlotKit/cyan", "dojox/charting/themes/PlotKit/green", "dojox/charting/themes/PlotKit/orange", |
| 66 |
"dojox/charting/themes/PlotKit/purple", "dojox/charting/themes/PlotKit/red" |
| 67 |
]; |
| 68 |
|
| 69 |
require(themes, function(){ |
| 70 |
var i = 0; |
| 71 |
var themeClasses = arguments; |
| 72 |
ready(function(){ |
| 73 |
arr.forEach(themes, function(theme){ |
| 74 |
// remove dojox/charting/themes from displayed name |
| 75 |
theme = theme.substring(22); |
| 76 |
// move / to . |
| 77 |
theme = theme.replace("/", "."); |
| 78 |
var container = domConstruct.create("div", { className: "container" }, "main"); |
| 79 |
var chart = domConstruct.create("div", { className: "chart" }, container); |
| 80 |
var title = domConstruct.create("div", { |
| 81 |
className: "title", |
| 82 |
innerHTML: 'See more of "<a href="test_themes-amd.html?' + theme + '">' + theme + '</a>"' |
| 83 |
}, container); |
| 84 |
var c = new Chart(chart). |
| 85 |
setTheme(themeClasses[i]). |
| 86 |
addPlot("default", {type: Pie, radius: 60, labelOffset: -20, radGrad: gfx.renderer == "vml" ? "fan" : "native"}). |
| 87 |
addSeries("Series A", [0.35, 0.25, 0.42, 0.53, 0.69]). |
| 88 |
render(); |
| 89 |
i++; |
| 90 |
}); |
| 91 |
}); |
| 92 |
}); |
| 93 |
}); |
| 94 |
</script> |
| 95 |
</head> |
| 96 |
<body> |
| 97 |
<h1>DojoX Charting Theme Preview</h1> |
| 98 |
<div id="main"></div> |
| 99 |
</body> |
| 100 |
</html> |