Horizontal line in Vertical bar graph

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

Horizontal line in Vertical bar graph

Post by Santosh Baranga » Thu Mar 07, 2002 11:41 pm

Hi All,
The JFreeChart works great. I need to display a horizontal line indicating the average value of the vertical bars (along with its value on the y axis). How do I go about this? I could not find this feature in the code (version 0.7.3).
Thanks,
Santosh

David Gilbert

Re: Horizontal line in Vertical bar graph

Post by David Gilbert » Fri Mar 08, 2002 1:03 pm

Hi Santosh,

There's no way to do that in JFreeChart at the moment, unless you modify the code a little.

Another developer added a feature to the XYPlot class to add horizontal and vertical lines to the plot at arbitrary values. You could implement something similar in the VerticalBarPlot class. You'll notice two calls in the XYPlot.draw(...) method that go off and draw the horizontal lines and the vertical lines...that would be one way to do it.

Regards,

DG

Locked