How to show the data

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Rajnesh
Posts: 19
Joined: Thu Jan 03, 2008 8:48 am

How to show the data

Post by Rajnesh » Fri Feb 15, 2008 7:13 am

Hi
I want to display the data points acc. to the tick marks at the x axis and y axis.Suppose we have tick marks at the the X axis as 5,10,15......
and for y its 100,150,200,250.............
and the data points is like( 5,100),(6,110)(8,130),(9,150),(11,180)................. now from this set of data i want that (5,100) (9,150) will display on the chart
is it possible ?Plzzzz help me
Awaiting for ur reply........
Thanx

mhilpert
Posts: 497
Joined: Wed Apr 02, 2003 1:57 pm
Location: Germany

Post by mhilpert » Fri Feb 15, 2008 11:43 am

Download JFreeChart and go into source\org\jfree\chart\demo that contains some example sources. Look into BarChartDemo1.java and you will learn to find your answer.
Java 11, JFreeChart 1.0.15, JFreeSVG 4.0

Rajnesh
Posts: 19
Joined: Thu Jan 03, 2008 8:48 am

How to show the data

Post by Rajnesh » Sat Feb 16, 2008 8:32 am

Hello
suppose a1 and b1 r the arraylist which contains data for x and Y axis

Code: Select all

for(int i=0;i<a1.size();i++)
        {
           
            double d= Double.parseDouble(a1.get(i).toString());
            double d1= Double.parseDouble(b1.get(i).toString());
            
           series1.add(d, d1);
        }
XYSeriesCollection dataset = new XYSeriesCollection();
dataset.addSeries(series1);
m using XYLineChart
now my problem is that i want the data points taht match with the XAxis Tick marks only displayed on the chart. others r not
like suppose i have X Axis tick marks like 1,2,3,4,5.......
and now i have value to be displayed like (1,1),(1.2,2)(1.7,2)(3.5,4)(4,5) .................something like that
now i want that from this set of data only values whose value corresponding to XAxis that equal to the XAxis tick values is displayed .
So plzzzzzzzz help me to solve this problem

Awaiting for ur reply :(
Thanx alot

Rajnesh
Posts: 19
Joined: Thu Jan 03, 2008 8:48 am

how to show data points

Post by Rajnesh » Tue Feb 19, 2008 9:41 am

Hi
Plzzzzzzzzzz help me to solve this problem.

Thanks in advance

Locked