projects
/
dygraphs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b263a46
)
clean up gviz selection test
author
Dan Vanderkam
<danvk@google.com>
Tue, 2 Mar 2010 19:20:44 +0000
(11:20 -0800)
committer
Dan Vanderkam
<danvk@google.com>
Tue, 2 Mar 2010 19:20:44 +0000
(11:20 -0800)
tests/gviz-selection.html
patch
|
blob
|
blame
|
history
diff --git
a/tests/gviz-selection.html
b/tests/gviz-selection.html
index
2f1a278
..
0fcc326
100644
(file)
--- a/
tests/gviz-selection.html
+++ b/
tests/gviz-selection.html
@@
-1,6
+1,6
@@
<html>
<head>
<html>
<head>
- <title>gviz</title>
+ <title>gviz
selection
</title>
<!--[if IE]>
<script type="text/javascript" src="excanvas.js"></script>
<![endif]-->
<!--[if IE]>
<script type="text/javascript" src="excanvas.js"></script>
<![endif]-->
@@
-9,7
+9,7
@@
<script type="text/javascript" src="../dygraph.js"></script>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
<script type="text/javascript" src="../dygraph.js"></script>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
- google.load('visualization', '1'
, {packages: ['linechart']}
);
+ google.load('visualization', '1');
function createDataTable(dateType) {
data = new google.visualization.DataTable();
function createDataTable(dateType) {
data = new google.visualization.DataTable();
@@
-49,7
+49,7
@@
data.setCell(9, 2, 8);
return data;
}
data.setCell(9, 2, 8);
return data;
}
-
+
var chart;
function drawVisualization() {
var chart;
function drawVisualization() {
@@
-59,7
+59,7
@@
chart.draw(data, {hideOverlayOnMouseOut: false});
}
chart.draw(data, {hideOverlayOnMouseOut: false});
}
-
+
function setSelection() {
var sel = [{column: 1, row: 2}, {column: 2, row: 2}];
chart.setSelection(sel);
function setSelection() {
var sel = [{column: 1, row: 2}, {column: 2, row: 2}];
chart.setSelection(sel);
@@
-70,11
+70,12
@@
}
function getChartSelection() {
var sel = chart.getSelection();
}
function getChartSelection() {
var sel = chart.getSelection();
-
+
var html = '<p>Selection: [';
var html = '<p>Selection: [';
- for (var i=0; i<sel.length; i++) {
- if (i>0) html += ', ';
- html += i + '=> {row: '+sel[i].row + ' col: '+ sel[i].column + '}';
+ for (var i = 0; i < sel.length; i++) {
+ if (i > 0) html += ', ';
+ html += i + '=> {row: '+ sel[i].row +
+ ' col: '+ sel[i].column + '}';
}
html += ']</p>';
document.getElementById('output').innerHTML += html;
}
html += ']</p>';
document.getElementById('output').innerHTML += html;
@@
-83,8
+84,7
@@
</script>
</head>
<body>
</script>
</head>
<body>
- <p>same data drawn using dygraphs:</p>
- date column:
+ <p>Get/Set/Clear selection via gviz API:</p>
<div id="dygraphs" style="width:600px; height:300px;"></div>
<input type="button" onclick="setSelection()" value="setSelection()"/>
<input type="button" onclick="clearSelection()" value="clearSelection()"/>
<div id="dygraphs" style="width:600px; height:300px;"></div>
<input type="button" onclick="setSelection()" value="setSelection()"/>
<input type="button" onclick="clearSelection()" value="clearSelection()"/>