Category Axis

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

Category Axis

Post by Pavel Grinfeld » Thu Jul 12, 2001 10:34 pm

Hi,

I've asked this question before and got a good answer but now I'm looking for a slightly different answer.

I'm plotting a histogram as Category Data. All's cool except that the x-axis gets really screwed up when there are many categories. I would like the x-axis to be an ordinary number-values axis. Is there a way for me to do it now without *too much* effort? Alternatively, can I draw a regular XY-data graph and paint in the area underneath the graph.

Many thanks in advance!

Pavel

David Gilbert

RE: Category Axis

Post by David Gilbert » Sun Jul 15, 2001 8:20 pm

Hi Pavel,

I've thought about how I might implement XYBarPlot, which will require an extension of the XYDataSource class as well as the new XYBarPlot class. The data source has to give the plot two X values (each side of the bar) as well as a Y value. In fact, I'll make XYBarDataSource return three X values - each side of the bar, and the original X value (middle of the bar). That way you can use the same datasource for XYPlots and XYBarPlots.

This will be a bit of effort, so you might want to direct your effort at getting the XYPlot to paint the area between the Y values and the axis. That should only require a modification to the draw(...) method.

If anyone feels like implementing any of this, I'm short of time (still!)...

Regards,

DG.

Locked