Solved

Plot a graph!!!

Posted on 2000-04-13
1
1,095 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

688 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