473,236 Members | 1,581 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,236 software developers and data experts.

Drawing graph charts using swings

hi friends, i have just moved from vba to java. i am quite new to java. but unexpectedly i was given a task to build a chart for a table stored in oracle database.

we have to use only swings technology.
and now my task is,

There will be a table in oracle database.
i have to draw a line chart for that table and show to user.

can any body place me in the correct track towards the solution.


thank you

.
Oct 31 '07 #1
11 4327
r035198x
13,262 8TB
hi friends, i have just moved from vba to java. i am quite new to java. but unexpectedly i was given a task to build a chart for a table stored in oracle database.

we have to use only swings technology.
and now my task is,

There will be a table in oracle database.
i have to draw a line chart for that table and show to user.

can any body place me in the correct track towards the solution.


thank you

.
By line chart you mean a line graph?
Have a look at the g.drawPolyLine method in the Graphics class.
Oct 31 '07 #2
By line chart you mean a line graph?
Have a look at the g.drawPolyLine method in the Graphics class.


Yes line graph(infact i have to draw line and bar graph).
i have table with two columns.
i have to draw line and bar graphs.

how can i make this using that method?


Thank you
Oct 31 '07 #3
r035198x
13,262 8TB
Yes line graph(infact i have to draw line and bar graph).
i have table with two columns.
i have to draw line and bar graphs.

how can i make this using that method?


Thank you
Did you read the specs for that method then?
Oct 31 '07 #4
Did you read the specs for that method then?
The method goes like this

************************************************** ****

public abstract void drawPolyline(int[] xPoints,
int[] yPoints,
int nPoints)Draws a sequence of connected lines defined by arrays of x and y coordinates. Each pair of (x, y) coordinates defines a point. The figure is not closed if the first point differs from the last point.

Parameters:
xPoints - an array of x points
yPoints - an array of y points
nPoints - the total number of points
************************************************** ******************

now, do you mean that i have to put my first column values into xPoints, and second column values into yPoints?
also what is nPoints?
Oct 31 '07 #5
r035198x
13,262 8TB
The method goes like this

************************************************** ****

public abstract void drawPolyline(int[] xPoints,
int[] yPoints,
int nPoints)Draws a sequence of connected lines defined by arrays of x and y coordinates. Each pair of (x, y) coordinates defines a point. The figure is not closed if the first point differs from the last point.

Parameters:
xPoints - an array of x points
yPoints - an array of y points
nPoints - the total number of points
************************************************** ******************

now, do you mean that i have to put my first column values into xPoints, and second column values into yPoints?
also what is nPoints?
The last line of the text you posted above says
nPoints - the total number of points
You have to set up somewhere to draw this of course, perhaps a Canvas (look it up) and then use it's graphics object to do the painting.
Oct 31 '07 #6
JosAH
11,448 Expert 8TB
Don't reinvent the wheel: use JFreeChart (or similar packages) instead.
It uses just Swing for the actual rendering.

kind regards,

Jos
Oct 31 '07 #7
The last line of the text you posted above says


You have to set up somewhere to draw this of course, perhaps a Canvas (look it up) and then use it's graphics object to do the painting.

Ok thank you.
i will do that.
Oct 31 '07 #8
r035198x
13,262 8TB
Ok thank you.
i will do that.
You should also consider the JFreeChart option suggested above. You are allowed to use it, right?
Oct 31 '07 #9
JosAH
11,448 Expert 8TB
You have to set up somewhere to draw this of course, perhaps a Canvas (look it up) and then use it's graphics object to do the painting.
For Swing, better use a JPanel

kind regards,

Jos
Oct 31 '07 #10
You should also consider the JFreeChart option suggested above. You are allowed to use it, right?

JFreeChart?

is that a external application? (please dont mind, i dont know)
i have searched for it in google and could find only demo version.
demo version allowed me to view charts but not the code.
Oct 31 '07 #11
r035198x
13,262 8TB
JFreeChart?

is that a external application? (please dont mind, i dont know)
i have searched for it in google and could find only demo version.
demo version allowed me to view charts but not the code.
Did you open the link posted by Jos above?
Nov 1 '07 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: SS KANAGAL | last post by:
Hello, I am drawing a bar graph in an aspx page using System.Drawing namespace . Now I want to provide drill down facility for the graph i.e. on click of a bar in the graph it should get me yet...
0
by: SS KANAGAL | last post by:
Hello, I am drawing a bar graph in an aspx page using System.Drawing namespace . Now I want to provide drill down facility for the graph i.e. on click of a bar in the graph it should get me yet...
1
by: JD Kronicz | last post by:
Hi .. I have an issue I have been beating my head against the wall on for some time. I am trying to use late binding for MS graph so that my end users don't have to worry about having the right...
6
by: David W. Fenton | last post by:
Is MS Graph really completely useless in Access 97? I uninstalled and re-installed to get the Office 97 version of MS Graph, but I see no way whatsoever to insert dynamic data into the chart....
2
by: borekfm | last post by:
Hitting two problems when running a new report I've created, that contains a chart/graph. The chart shows three series, two are shown as lines and one as an area. The data come from three different...
0
by: ANUPAM | last post by:
Hi All, I have to show Tooltip for Bar/Pie graph using MS charts control in C# which is not available while it is in Visual Basic Version. Please help me. Thansks All, Anupam
3
by: sumuka | last post by:
Hello, I'm doing a project in java using swings ,im able to create a panel and frame but i have a problem in event handling.I have added the MouseMotionListener but it's giving some error .Here i...
2
by: san1014 | last post by:
Hi I have a table like this sql> select * from commodity; commodity_id year value ---------------------- ------- --------- C1 1996 20 C1 ...
3
by: The Frog | last post by:
Hi guys, I have never touched really on this area before with forms and reports, and now I would like to be able to incorporate some graphs / charts for a new little app I am building, and I...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.