Urgent! Line chart

Hello,I was wondering how do I draw a line chart using graphics g method.Thanks,pal
[118 byte] By [palv] at [2007-9-26 2:44:42]
# 1

Hi Pal

The line chart can be drawn using the drawLine()

method.The y values are ploted by geting the height of the paint area and the values of each y axis element is manapulated to get the hight of each line.

First tell me ur developing an applet or application and also the type of data ur using to draw the chart so that i can help u

-vijay

jvijaykmr@yahoo.com

vijaykmr at 2007-6-29 10:25:23 > top of Java-index,Archived Forums,Java Programming...
# 2

Hello,

Thanks for the fast replay i'm actually developing an applet. Whereby in this applet suppose to draw lines according to the user input.

My codes are as below:

case 3:

g.drawLine(50,200,50,400);

g.drawLine(50,400,250,400);

//g.setColor(Color.red);

//g.drawLine(50,400,100,(a1a*2));

g.setColor(Color.red);

g.fillRect(300,200,20,20);

g.setColor(Color.yellow);

g.fillRect(300,230,20,20);

g.setColor(new Color(231,80,226));

g.fillRect(300,260,20,20);

g.setColor(Color.blue);

g.fillRect(300,290,20,20);

g.drawString("High Risk",330,213);

g.drawString("Medium Risk",330,243);

g.drawString("Low Risk",330,273);

g.drawString("No Risk",330,303);

break;

your help is greatly appreaciated,

thanks,

pal

palv at 2007-6-29 10:25:23 > top of Java-index,Archived Forums,Java Programming...
# 3
Hey there,I have figure it outThanks anyways!pal
palv at 2007-6-29 10:25:23 > top of Java-index,Archived Forums,Java Programming...
# 4

Hi Palv

I coul not understand what ur doing from ur code

pls look at my applet at this site

http://www.digitaltantra.com/chart/client.htm

Let me know this is the type of chart ur doing

I am leaving for the day so

mail me to jvijaykmr@yahoo.com

bye

-vijay

vijaykmr at 2007-6-29 10:25:23 > top of Java-index,Archived Forums,Java Programming...