|
-
Graph from array of numbers
Does any one know how to create a bar and line graph separately from any array of numbers?
For example int test[] ={0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,300};
To be simple I was trying to draw a bar graph by using
g.drawRect(0, 10, 2, 0);
g.drawRect(20, 20, 2, 20);
g.drawRect(40, 30, 2, 40);
This draws the bars out of rectangle, but they are not leveled.
I tried making each of the Ys the same:
g.drawRect(0, 10, 2, 0);
g.drawRect(20, 10, 2, 20);
g.drawRect(40, 10, 2, 40);
This resulted in the bars (rectangles) being on the same line but appearing to be upside down.
As far as quadrants in geometry, it looks as though I'm drawing to the wrong one.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks