Solved

Plot a graph!!!

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SHA2 certs for IIS AND Java? 2 122
SequenceInputStream example 3 22
Fast way to search item into Java Array (Rhino compatible) 2 39
java mysql insert application 14 47
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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.
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 about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

726 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