Customized Value in X Axis

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Vijaya Natarajan

Customized Value in X Axis

Post by Vijaya Natarajan » Sun Dec 17, 2000 2:53 am

Hi,
After a long hunting I found JFreeChart and I was so impressed
by its capabilities.
Actually, I need a very simple XY plot graph,
we need to show the following test table in the graph form
=================
File1 90%
File2 80%
File3 55%
=================
I chose % for Y-axis and FileNames for X-axis.
I tried with XY Plot graph, this is my following test
data,

Object[][][] data =
new Object[][][] {{{new Integer(1), new Integer(90)},
{new Integer(2), new Integer(80)},
{new Integer(3), new Integer(70)}};

I tried to give new String("File1") but it takes it as
"0" instead, so I tried to give as above.
I think that I should not use XYPlot for my purpose,
may be I have to use Horizontal Bar or Vertical Bar, right ?
Please let me know.
Thanks.
--Viji

David Gilbert

RE: Customized Value in X Axis

Post by David Gilbert » Mon Dec 18, 2000 8:20 am

Hi Vijaya,

In the current implementation, there are two types of data.

The CategoryDataSource interface describes data in the form (category, value) which I think is what you want. Using this type of data, you can produce bar charts, line charts and pie charts.

The XYDataSource interface describes data in the form (x, y) where x and y are both numbers. You can use this type of data for xy-plots and time series.

Have a look through the source code for the demonstration application for more info.

Regards,

DG.

Locked