File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes how to generate graph from a database? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "how to generate graph from a database?" Watch "how to generate graph from a database?" New topic
Author

how to generate graph from a database?

malhar deshpande
Greenhorn

Joined: Nov 12, 2011
Posts: 5
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>

Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2407
What does "not working" mean - does the computer blow up?
malhar deshpande
Greenhorn

Joined: Nov 12, 2011
Posts: 5
It means that after clicking the button graph is not displayed on the screen.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2407
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?
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4163
    
    3

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.


luck, db
There are no new questions, but there may be new answers.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: how to generate graph from a database?
 
Similar Threads
this.title returning undefined
Triggering jQuery events without knowing the selector to trigger?
not able to get width and height of another html file inside html
center a div inside a div
Can't get jQuery to have effect