| 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, gfxRenderer: 'svg,silverlight,vml,canvas'"></script> |
| 48 |
<script type="text/javascript"> |
| 49 |
dojo.require("dojox.charting.Chart"); |
| 50 |
dojo.require("dojox.charting.plot2d.Pie"); |
| 51 |
|
| 52 |
var themes = [ |
| 53 |
"Julie", "ThreeD", "Chris", "Tom", "Claro", "PrimaryColors", "Electric", "Charged", "Renkoo", |
| 54 |
"Adobebricks", "Algae", "Bahamation", "BlueDusk", "CubanShirts", "Desert", "Distinctive", "Dollar", |
| 55 |
"Grasshopper", "Grasslands", "GreySkies", "Harmony", "IndigoNation", "Ireland", "MiamiNice", |
| 56 |
"Minty", "PurpleRain", "RoyalPurples", "SageToLime", "Shrooms", "Tufte", "WatersEdge", "Wetland", |
| 57 |
"PlotKit.blue", "PlotKit.cyan", "PlotKit.green", "PlotKit.orange", "PlotKit.purple", "PlotKit.red" |
| 58 |
]; |
| 59 |
|
| 60 |
dojo.forEach(themes, function(theme){ dojo.require("dojox.charting.themes." + theme); }) |
| 61 |
|
| 62 |
dojo.ready(function(){ |
| 63 |
dojo.forEach(themes, function(theme){ |
| 64 |
var container = dojo.create("div", { className: "container" }, "main"); |
| 65 |
var chart = dojo.create("div", { className: "chart" }, container); |
| 66 |
var title = dojo.create("div", { |
| 67 |
className: "title", |
| 68 |
innerHTML: 'See more of "<a href="test_themes.html?' + theme + '">' + theme + '</a>"' |
| 69 |
}, container); |
| 70 |
var c = new dojox.charting.Chart(chart). |
| 71 |
setTheme(dojo.getObject("dojox.charting.themes." + theme)). |
| 72 |
addPlot("default", {type: "Pie", radius: 60, labelOffset: -20, radGrad: dojox.gfx.renderer == "vml" ? "fan" : "native"}). |
| 73 |
addSeries("Series A", [0.35, 0.25, 0.42, 0.53, 0.69]). |
| 74 |
render(); |
| 75 |
}); |
| 76 |
}); |
| 77 |
</script> |
| 78 |
</head> |
| 79 |
<body> |
| 80 |
<h1>DojoX Charting Theme Preview</h1> |
| 81 |
<div id="main"></div> |
| 82 |
</body> |
| 83 |
</html> |