Results 1 to 2 of 2

Thread: How can I display more then one Javascript Graph on the same HTML page

  1. #1
    santana Guest

    How can I display more then one Javascript Graph on the same HTML page

    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 Code:
    <html>
    <head>
    <title>Graph</title>
    <body>
    <title>Data</title>
    <p align="center">&nbsp;</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>
    Last edited by is_numeric; 29 Oct 2009 at 10:48 AM.

  2. #2
    Join Date
    Apr 2009
    Location
    The toon
    Posts
    1,225
    Code:
    <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");
    
    //////////////
    
    var h = new line_graph();
    
    h.add(' 1.0',197);
    h.add(' 2.0',721);
    h.add(' 3.0',852);
    
    h.render("lineCanvas","test2");
    
    ///////////////
    
    var s = new line_graph();
    
    s.add(' 1.0',197);
    s.add(' 2.0',721);
    s.add(' 3.0',852);
    
    s.render("lineCanvas","test3");
    
    </script>
    
    
    <p align="left"><font size="2"><b>Test </b></font></p>
    <p align="left"><font size="2"><b>Test2 </b></font></p>
    <p align="left"><font size="2"><b>Test3 </b></font></p>
    Have you looked at the free google chart api

    http://code.google.com/apis/chart/

Similar Threads

  1. Help!! How to add a thank you page in html when submitting a form
    By clarky18 in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 24 Jul 2009, 06:08 AM
  2. Dumb Newb Question: Why doesn't page size display work in DW CS3?
    By Stearmandriver in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 21 Feb 2008, 03:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •