Solved

Plot a graph!!!

Posted on 2000-04-13
1
1,089 Views
Last Modified: 2008-03-06
Hello,

I am a beginner in using Java to write an applet.

Now I need to read data from a SQL server and then plot a graph by using the data from the server.

Is there any good exmaple existed which can download from the web?

Furthermore, if I have used the Perl script to read data from SQL server, can I pass the data to the Java Program??? if yes, how can I do this?

Thank you for your opinion?

0
Comment
Question by:cplau
1 Comment
 

Accepted Solution

by:
bava_anand earned 80 total points
ID: 2712967
It's very easy.

In the question u have mentioned himself had the solution.

The only thing is you have to be good or concentrate in writing applet with the knowledge of the methods involved in Graphics.

1) The first thing u have to do is to construte the Applet tag dynamically (Using Perl Script or ASP) with the java class file name( your java program) and the various data needed for ploting the graph placed in the Parameter tag.

like below

<html>
<body>
<applet  CODE="Graph.class" Width="500" Height="150">
<param name=GraphData value="OGL,12.45,14.34,16.854,18.23,20.234,18.233,16.234,14.23,12.34,^
       SDBC,8.45,9.34,10.854,11.23,12.234,11.233,10.234,9.23,8.34,^
       BM,6.45,7.34,8.854,9.23,10.234,9.233,8.234,7.23,6.34,^">
</applet>
</body>

2) The next thing is writing the Graph.java program that reads the data from the parameter provided in the applet tag and plots the graph according
to your spec without any flicker problem by using drawimage instead of paint.

Str = getParameter("GraphData")

I think this will solve your problem.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now