• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to generate graph from a database?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to generate graph using the values of the database dynamically . I have developed this code but it's still not working......help us ASAP.The two javascript files that are used as a source are downloadable from www.dynamicdrive.com & write graphs in search tab.


<% mypack.Student s=new Student();
ResultSet rs=s.viewAllB(); %>

<html>
<head>
<title>Graph</title>
<script type="text/javascript" src="C:\Documents and Settings\HP_Owner\Desktop\site2\line.js"></script>
<script type="text/javascript" src="C:\Documents and Settings\HP_Owner\Desktop\site2\wz_jsgraphics.js"></script>
<script type="text/javascript">
function drw()
{
var g = new line_graph();
g.add(rs.getString(2),rs.getString(1));
g.add("12",70);

g.render("canvas_name", "statistics");
}

</script>
</head>
<body>
<input type="button" onclick="drw()" value="Click"/>

<div id="canvas_name" style="margin-top:500;margin-left:500">

</div>
</body>
</html>

 
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What does "not working" mean - does the computer blow up?
 
malhar deshpande
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It means that after clicking the button graph is not displayed on the screen.
 
Tim Moores
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Some questions in no particular order (all of which you'll need to be able to answer in order to figure this out): What's the output you're getting in your browser's console? What's the output you're getting in your servlet container's log file? What is the HTML that's getting generated - is it correct, and as you imagined it would be? Is the function "drw" being called?
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

malhar deshpande wrote:help us ASAP.


Please EaseUp <-- link PatienceIsAVirtue <-- link

I don't see anything that pertains to Applets. Moving to the HTML, CSS and JS forum.
 
Friends help you move. Good friends help you move bodies. This tiny ad will help:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic