projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
create failing errorBars test
[dygraphs.git]
/
tests
/
plotter.html
diff --git
a/tests/plotter.html
b/tests/plotter.html
index
f36573b
..
414197a
100644
(file)
--- a/
tests/plotter.html
+++ b/
tests/plotter.html
@@
-1,18
+1,23
@@
+<!DOCTYPE html>
<html>
<head>
<html>
<head>
+ <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9">
<title>dygraphs Equation Plotter</title>
<!--[if IE]>
<title>dygraphs Equation Plotter</title>
<!--[if IE]>
- <script type="text/javascript" src="excanvas.js"></script>
+ <script type="text/javascript" src="
../
excanvas.js"></script>
<![endif]-->
<![endif]-->
- <script type="text/javascript" src="../dygraph-combined.js"></script>
- <script type="text/javascript" src="../dygraph-canvas.js"></script>
- <script type="text/javascript" src="../dygraph.js"></script>
+ <!--
+ For production (minified) code, use:
+ <script type="text/javascript" src="dygraph-combined.js"></script>
+ -->
+ <script type="text/javascript" src="../dygraph-dev.js"></script>
+
<script type="text/javascript">
function plot() {
var eq = document.getElementById("eq").value;
eval("fn = " + eq);
<script type="text/javascript">
function plot() {
var eq = document.getElementById("eq").value;
eval("fn = " + eq);
- var graph = document.getElementById("graph");
+ var graph = document.getElementById("graph
_div
");
var width = parseInt(graph.style.width);
var x1 = parseFloat(document.getElementById("x1").value);
var x2 = parseFloat(document.getElementById("x2").value);
var width = parseInt(graph.style.width);
var x1 = parseFloat(document.getElementById("x1").value);
var x2 = parseFloat(document.getElementById("x2").value);
@@
-33,7
+38,18
@@
data.push(row);
}
data.push(row);
}
- g = new Dygraph(graph, data);
+ var labels = ['X'];
+ if (data[0].length == 2) {
+ labels.push('Y');
+ } else {
+ for (var i = 0; i < data[0].length; i++) {
+ labels.push('Y' + (1 + i));
+ }
+ }
+
+ g = new Dygraph(graph, data, {
+ labels: labels
+ });
}
function preset() {
}
function preset() {
@@
-72,6
+88,6
@@
to <input type=text width="5" id="x2" value="10" /></p>
<p><input type=button value="Plot" onClick="plot()" /></p>
to <input type=text width="5" id="x2" value="10" /></p>
<p><input type=button value="Plot" onClick="plot()" /></p>
- <div id=
graph
style="width:1024px; height:400px;"></div>
+ <div id=
"graph_div"
style="width:1024px; height:400px;"></div>
</body>
</html>
</body>
</html>