?
Solved

Plot a graph!!!

Posted on 2000-04-13
1
Medium Priority
?
1,097 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 240 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
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.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses
Course of the Month9 days, 2 hours left to enroll

764 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