| 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 |
<title>Gradient: Bars #4</title> |
| 18 |
<script type="text/javascript" src="../../../../dojo/dojo.js" data-dojo-config="isDebug: true"></script> |
| 19 |
<script> |
| 20 |
dojo.require("dojox.charting.Chart"); |
| 21 |
dojo.require("dojox.charting.axis2d.Default"); |
| 22 |
dojo.require("dojox.charting.plot2d.Bars"); |
| 23 |
dojo.require("dojox.charting.plot2d.ClusteredBars"); |
| 24 |
dojo.require("dojox.charting.plot2d.StackedBars"); |
| 25 |
dojo.require("dojox.charting.Theme"); |
| 26 |
|
| 27 |
run = function(){ |
| 28 |
dojo.attr("start", "disabled", true); |
| 29 |
|
| 30 |
var theme1 = new dojox.charting.Theme({ |
| 31 |
seriesThemes: [ |
| 32 |
{ |
| 33 |
fill: { |
| 34 |
type: "linear", space: "shapeX", x1: 0, y1: 0, x2: 100, y2: 100, |
| 35 |
colors: [{ offset: 0, color: "white" }, { offset: 1, color: "red" }] |
| 36 |
} |
| 37 |
}, |
| 38 |
{ |
| 39 |
fill: { |
| 40 |
type: "linear", space: "shapeX", x1: 0, y1: 0, x2: 0, y2: 100, |
| 41 |
colors: [{ offset: 0, color: "white" }, { offset: 1, color: "blue" }] |
| 42 |
} |
| 43 |
}, |
| 44 |
{ |
| 45 |
fill: { |
| 46 |
type: "linear", space: "shapeY", x1: 0, y1: 0, x2: 100, y2: 100, |
| 47 |
colors: [{ offset: 0, color: "white" }, { offset: 1, color: "green" }] |
| 48 |
} |
| 49 |
} |
| 50 |
] |
| 51 |
}); |
| 52 |
|
| 53 |
var chart1 = new dojox.charting.Chart("c1"). |
| 54 |
setTheme(theme1). |
| 55 |
addAxis("x", {fixLower: "major", fixUpper: "major", includeZero: true, minorTickStep: 0.2}). |
| 56 |
addAxis("y", {vertical: true, fixLower: "major", fixUpper: "major", natural: true}). |
| 57 |
addPlot("default", {type: "Bars"}). |
| 58 |
addSeries("Series A", [1, 2, 3, 4, 5]). |
| 59 |
addSeries("Series B", [5, 4, 3, 2, 1]). |
| 60 |
render(); |
| 61 |
|
| 62 |
var chart2 = new dojox.charting.Chart("c2"). |
| 63 |
setTheme(theme1). |
| 64 |
addAxis("x", {fixLower: "major", fixUpper: "major", includeZero: true, minorTickStep: 0.5}). |
| 65 |
addAxis("y", {vertical: true, fixLower: "major", fixUpper: "major", natural: true}). |
| 66 |
addPlot("default", {type: "StackedBars"}). |
| 67 |
addSeries("Series A", [2, 3, 3, 3, 5]). |
| 68 |
addSeries("Series B", [1, 4, 5, 2, 1]). |
| 69 |
addSeries("Series C", [2, 1, 2, 1, 3]). |
| 70 |
render(); |
| 71 |
|
| 72 |
var chart3 = new dojox.charting.Chart("c3"). |
| 73 |
setTheme(theme1). |
| 74 |
addAxis("x", {fixLower: "major", fixUpper: "major", includeZero: true, minorTickStep: 0.5}). |
| 75 |
addAxis("y", {vertical: true, fixLower: "major", fixUpper: "major", natural: true}). |
| 76 |
addPlot("default", {type: "ClusteredBars", gap: 5}). |
| 77 |
addSeries("Series A", [2, 3, 3, 3, 5]). |
| 78 |
addSeries("Series B", [1, 4, 5, 2, 1]). |
| 79 |
addSeries("Series C", [2, 1, 2, 1, 3]). |
| 80 |
render(); |
| 81 |
}; |
| 82 |
|
| 83 |
dojo.addOnLoad(run); |
| 84 |
</script> |
| 85 |
</head> |
| 86 |
<body> |
| 87 |
<p><button id="start" onclick="run();">Start!</button></p> |
| 88 |
<h1>1D shape-space gradient</h1> |
| 89 |
<p>Bars</p> |
| 90 |
<div id="c1" style="position: relative; width: 600px; height: 400px;"></div> |
| 91 |
<p>Stacked Bars</p> |
| 92 |
<div id="c2" style="position: relative; width: 600px; height: 400px;"></div> |
| 93 |
<p>Clustered Bars</p> |
| 94 |
<div id="c3" style="position: relative; width: 600px; height: 400px;"></div> |
| 95 |
</body> |
| 96 |
</html> |