1 // Copyright (c) 2012 Google, Inc.
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and associated documentation files (the "Software"), to deal
5 // in the Software without restriction, including without limitation the rights
6 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 // copies of the Software, and to permit persons to whom the Software is
8 // furnished to do so, subject to the following conditions:
10 // The above copyright notice and this permission notice shall be included in
11 // all copies or substantial portions of the Software.
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * @fileoverview Source samples.
24 * @author konigsberg@google.com (Robert Konigsberg)
32 id
: "interestingShapes",
33 title
: "Interesting Shapes",
35 var zp
= function(x
) { if (x
< 10) return "0"+x
; else return x
; };
36 var r
= "date,parabola,line,another line,sine wave\n";
37 for (var i
=1; i
<=31; i
++) {
38 r
+= "201110" + zp(i
);
39 r
+= "," + 10*(i
*(31-i
));
41 r
+= "," + 10*(250 - 8*i
);
42 r
+= "," + 10*(125 + 125 * Math
.sin(0.3*i
));
54 labelsSeparateLines
: true,
59 title
: 'Interesting Shapes',
62 axisLineColor
: 'white',
64 pointClickCallback
: function() {
74 [ new Date("2009/12/01"), 10, 10, 10],
75 [ new Date("2009/12/02"), 15, 11, 12],
76 [ new Date("2009/12/03"), null, null, 12],
77 [ new Date("2009/12/04"), 20, 14, null],
78 [ new Date("2009/12/05"), 15, null, 17],
79 [ new Date("2009/12/06"), 18, null, null],
80 [ new Date("2009/12/07"), 12, 14, null]
83 labels
: ["Date", "Series1", "Series2", "Series3"]
96 var xmax
= 2.0 * Math
.PI
;
98 var delta
= (xmax
- xmin
) / (numPoints
- 1);
100 for (var i
= 0; i
< numPoints
; ++i
) {
101 var x
= xmin
+ delta
* i
;
103 for (var j
= 0; j
< numSeries
; j
++) {
104 var y
= Math
.pow(Math
.random() - Math
.random(), 7);
112 labelsSeparateLines
: true,
115 title
: 'Many Points',
116 axisLineColor
: 'white',
141 Samples
.indexOf
= function(id
) {
142 for (var idx
in Samples
.data
) {
143 if (Samples
.data
[idx
].id
== id
) {