Solved

Plot a graph!!!

Posted on 2000-04-13
1
1,087 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

746 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

12 Experts available now in Live!

Get 1:1 Help Now