Can I create this simple graph?

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

Can I create this simple graph?

Post by Phillip Rhodes » Wed Jun 19, 2002 4:16 am

Sorry. Pictures say a thousand words, so here is
<a href="http://test.jsurvey.com/images/graph.jpg">one</a>

It has a range of 0 to 100%
4 labels on the x axis

Range/Label
0-25 "minimal"
02-50 "moderate"
50-75 "major"
75-100 "severe"

I did not see in the API a way to do the labels on the x axis. Thanks for letting me know if it is possible to use this package to generate this graph. If it's possible, I will buy documentation today.
Thanks!
Phillip

Phillip Rhodes

Re: Can I create this simple graph?

Post by Phillip Rhodes » Wed Jun 19, 2002 4:17 am

Oh, it's a bar chart.

David Gilbert

Re: Can I create this simple graph?

Post by David Gilbert » Wed Jun 19, 2002 8:48 am

Hi Phillip,

There's no support for labelling the axis in this way (or for displaying the axis at the top as in your example). But it shouldn't be that difficult to extend the existing axis to show the labelled ranges...I'll see if I can do it later today.

Regards,

DG.

David Gilbert

Re: Can I create this simple graph?

Post by David Gilbert » Wed Jun 19, 2002 11:52 am

I have made a few changes that will allow ranges to be labelled on the number axis. Here is an example:

http://www.object-refinery.com/jfreecha ... ndaxis.png

It's not exactly the same as the example you gave, but close.

The code is still pretty rough, but I'll commit the changes to CVS on SourceForge if you want to take a look (two new classes HorizontalMarkerAxisBand and IntervalMarker, plus some changes to HorizontalNumberAxis and the HorizontalBarChartDemo application).

Regards,

DG.

Phillip Rhodes

Re: Can I create this simple graph?

Post by Phillip Rhodes » Wed Jun 19, 2002 12:27 pm

I think this graph comes pretty close!

Let me know when you have CVS updated and I will go from there.
Thanks.

David Gilbert

Re: Can I create this simple graph?

Post by David Gilbert » Wed Jun 19, 2002 12:30 pm

It should be there now.

Regards,

DG.

Locked