santana
29 Oct 2009, 05:06 AM
How can I display more then one Javascript Graph on the same HTML page. everytime to add another graph, one will work and the rest of the graphs will not. Is there a way to display more then one graph.
Here is the code:
<html>
<head>
<title>Graph</title>
<body>
<title>Data</title>
<p align="center"> </p>
<p align="center"><font size="4"><b>test</b></font></p>
<center>
<script type="text/javascript" src=".\JavaFiles\wz_jsgraphics.js"></script>
<script type="text/javascript" src=".\JavaFiles\line.js"></script>
<div id="lineCanvas" style="overflow: auto; position:center;height:300px;width:800px;"></div>
<script type="text/javascript">
var g = new line_graph();
g.add(' 1.0',197);
g.add(' 2.0',721);
g.add(' 3.0',852);
g.render("lineCanvas","test");
</script>
<p align="left"><font size="2"><b>Test </b></font></p>
</body>
Here is the code:
<html>
<head>
<title>Graph</title>
<body>
<title>Data</title>
<p align="center"> </p>
<p align="center"><font size="4"><b>test</b></font></p>
<center>
<script type="text/javascript" src=".\JavaFiles\wz_jsgraphics.js"></script>
<script type="text/javascript" src=".\JavaFiles\line.js"></script>
<div id="lineCanvas" style="overflow: auto; position:center;height:300px;width:800px;"></div>
<script type="text/javascript">
var g = new line_graph();
g.add(' 1.0',197);
g.add(' 2.0',721);
g.add(' 3.0',852);
g.render("lineCanvas","test");
</script>
<p align="left"><font size="2"><b>Test </b></font></p>
</body>