| 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: Columns #1</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.Columns"); |
| 23 |
dojo.require("dojox.charting.plot2d.ClusteredColumns"); |
| 24 |
dojo.require("dojox.charting.plot2d.StackedColumns"); |
| 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: "plot", x1: 0, y1: 0, x2: 100, y2: 0, |
| 35 |
colors: [{ offset: 0, color: "#ed0" }, { offset: 0.5, color: "#eda" }, { offset: 1, color: "#ed0" }] |
| 36 |
} |
| 37 |
}, |
| 38 |
{ |
| 39 |
fill: { |
| 40 |
type: "linear", space: "plot", x1: 0, y1: 0, x2: 100, y2: 0, |
| 41 |
colors: [{ offset: 0, color: "#e00" }, { offset: 0.5, color: "#eaa" }, { offset: 1, color: "#e00" }] |
| 42 |
} |
| 43 |
}, |
| 44 |
{ |
| 45 |
fill: { |
| 46 |
type: "linear", space: "plot", x1: 0, y1: 0, x2: 100, y2: 0, |
| 47 |
colors: [{ offset: 0, color: "#0e0" }, { offset: 0.5, color: "#aea" }, { offset: 1, color: "#0e0" }] |
| 48 |
} |
| 49 |
}, |
| 50 |
{ |
| 51 |
fill: { |
| 52 |
type: "linear", space: "plot", x1: 0, y1: 0, x2: 100, y2: 0, |
| 53 |
colors: [{ offset: 0, color: "#00e" }, { offset: 0.5, color: "#aae" }, { offset: 1, color: "#00e" }] |
| 54 |
} |
| 55 |
} |
| 56 |
] |
| 57 |
}); |
| 58 |
|
| 59 |
var chart1 = new dojox.charting.Chart("c1"). |
| 60 |
setTheme(theme1). |
| 61 |
addAxis("x", {fixLower: "major", fixUpper: "major", natural: true}). |
| 62 |
addAxis("y", {vertical: true, fixLower: "major", fixUpper: "major", includeZero: true, minorTickStep: 0.5}). |
| 63 |
addPlot("default", {type: "Columns"}). |
| 64 |
addSeries("Series A", [1, 2, 3, 4, 5]). |
| 65 |
addSeries("Series B", [5, 4, 3, 2, 1]). |
| 66 |
render(); |
| 67 |
|
| 68 |
var chart2 = new dojox.charting.Chart("c2"). |
| 69 |
setTheme(theme1). |
| 70 |
addAxis("x", {fixLower: "major", fixUpper: "major", natural: true}). |
| 71 |
addAxis("y", {vertical: true, fixLower: "major", fixUpper: "major", includeZero: true, minorTickStep: 0.5}). |
| 72 |
addPlot("default", {type: "StackedColumns"}). |
| 73 |
addSeries("Series A", [2, 3, 3, 3, 5]). |
| 74 |
addSeries("Series B", [1, 4, 5, 2, 1]). |
| 75 |
addSeries("Series C", [2, 1, 2, 1, 3]). |
| 76 |
render(); |
| 77 |
|
| 78 |
var chart3 = new dojox.charting.Chart("c3"). |
| 79 |
setTheme(theme1). |
| 80 |
addAxis("x", {fixLower: "major", fixUpper: "major", natural: true}). |
| 81 |
addAxis("y", {vertical: true, fixLower: "major", fixUpper: "major", includeZero: true, minorTickStep: 0.5}). |
| 82 |
addPlot("default", {type: "ClusteredColumns", gap: 5}). |
| 83 |
addSeries("Series A", [2, 3, 3, 3, 5]). |
| 84 |
addSeries("Series B", [1, 4, 5, 2, 1]). |
| 85 |
addSeries("Series C", [2, 1, 2, 1, 3]). |
| 86 |
render(); |
| 87 |
}; |
| 88 |
|
| 89 |
dojo.addOnLoad(run); |
| 90 |
</script> |
| 91 |
</head> |
| 92 |
<body> |
| 93 |
<p><button id="start" onclick="run();">Start!</button></p> |
| 94 |
<h1>plot-space left-to-right gradient</h1> |
| 95 |
<p>Columns</p> |
| 96 |
<div id="c1" style="position: relative; width: 600px; height: 400px;"></div> |
| 97 |
<p>Stacked Columns</p> |
| 98 |
<div id="c2" style="position: relative; width: 600px; height: 400px;"></div> |
| 99 |
<p>Clustered Columns</p> |
| 100 |
<div id="c3" style="position: relative; width: 600px; height: 400px;"></div> |
| 101 |
</body> |
| 102 |
</html> |