473,403 Members | 2,071 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,403 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 4346
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.