Debian Codegraph @

dojox/charting/tests/gradients/test_grad_scatter1.html

raw symbols SCIP
1 <!--[if IE 7]>
2 <!DOCTYPE>
3 <html lang="en">
4 <head>
5 <![endif]-->
6 <!--[if IE 8]>
7 <!DOCTYPE>
8 <html lang="en">
9 <head>
10 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
11 <![endif]-->
12 <![if gte IE 9]>
13 <!DOCTYPE HTML>
14 <html lang="en">
15 <head>
16 <![endif]>
17 <title>Gradient: Scatter #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.Scatter");
23 dojo.require("dojox.charting.Theme");
24
25 run = function(){
26 dojo.attr("start", "disabled", true);
27
28 var theme1 = new dojox.charting.Theme({
29 seriesThemes: [
30 {
31 fill: {
32 type: "linear", space: "plot", x1: 0, y1: 0, x2: 100, y2: 0,
33 colors: [{ offset: 0, color: "#ed0" }, { offset: 0.5, color: "#eda" }, { offset: 1, color: "#ed0" }]
34 }
35 },
36 {
37 fill: {
38 type: "linear", space: "plot", x1: 0, y1: 0, x2: 100, y2: 0,
39 colors: [{ offset: 0, color: "#e00" }, { offset: 0.5, color: "#eaa" }, { offset: 1, color: "#e00" }]
40 }
41 },
42 {
43 fill: {
44 type: "linear", space: "plot", x1: 0, y1: 0, x2: 100, y2: 0,
45 colors: [{ offset: 0, color: "#0e0" }, { offset: 0.5, color: "#aea" }, { offset: 1, color: "#0e0" }]
46 }
47 },
48 {
49 fill: {
50 type: "linear", space: "plot", x1: 0, y1: 0, x2: 100, y2: 0,
51 colors: [{ offset: 0, color: "#00e" }, { offset: 0.5, color: "#aae" }, { offset: 1, color: "#00e" }]
52 }
53 }
54 ]
55 });
56
57 var run1 = [], run2 = [], run3 = [];
58 for(var i = 0; i < 12; ++i){
59 for(var j = 0; j < 8; ++j){
60 run1.push({x: i + 0.7, y: j + 0.7});
61 run2.push({x: i + 1.3, y: j + 1.3});
62 run3.push({x: i + 0.7, y: j + 1.3});
63 }
64 }
65
66 var chart1 = new dojox.charting.Chart("c1").
67 setTheme(theme1).
68 addAxis("x", {includeZero: true, minorLabels: false}).
69 addAxis("y", {vertical: true, includeZero: true, minorLabels: false}).
70 addPlot("default", {type: "Scatter"}).
71 addSeries("Series A", run1).
72 addSeries("Series B", run2).
73 addSeries("Series C", run3).
74 render();
75 };
76
77 dojo.addOnLoad(run);
78 </script>
79 </head>
80 <body>
81 <p><button id="start" onclick="run();">Start!</button></p>
82 <h1>plot-space left-to-right gradient</h1>
83 <p>Scatter</p>
84 <div id="c1" style="position: relative; width: 600px; height: 400px;"></div>
85 </body>
86 </html>