A line chart with dots

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

A line chart with dots

Post by Carlos » Mon Dec 09, 2002 2:16 pm

Hi,

I've started use jfreechart.
My doubts:
How can I get small rectangles for the values in a line chart?
Can I restrict the range of the values for my chart?

Regards,

Kolb.

David Gilbert

Re: A line chart with dots

Post by David Gilbert » Mon Dec 09, 2002 11:05 pm

Hi Kolb,

To draw shapes on a line chart in 0.9.4, you need to create a new LineAndShapeRenderer class, then set it with the setRenderer(...) method in the CategoryPlot class.

You can control the range of values displayed on your chart using the setRange(...) method in the ValueAxis class. Use something like this:

CategoryPlot plot = myChart.getCategoryPlot();
ValueAxis axis = plot.getRangeAxis();
axis.setRange(10.0, 25.0);

Regards,

Dave Gilbert

Locked