Adding permanent/anchor horizontal lines on chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
paololim
Posts: 11
Joined: Tue Jul 17, 2007 3:08 pm
Location: Hopewell Junction, NY

Adding permanent/anchor horizontal lines on chart

Post by paololim » Wed Aug 08, 2007 9:01 pm

Hi. How do I add permanent horizontal lines on a chart? For example, if I want a solid horizontal line where Y=3 and Y=-3, where the X-value doesn't have any bearing. The lines also would not have a separate legend from all the other series lines. How do I do this?

Thanks ahead.

RichardWest
Posts: 844
Joined: Fri Oct 13, 2006 9:29 pm
Location: Sunnyvale, CA

Re: Adding permanent/anchor horizontal lines on chart

Post by RichardWest » Wed Aug 08, 2007 9:31 pm

paololim wrote:How do I add permanent horizontal lines on a chart? For example, if I want a solid horizontal line where Y=3 and Y=-3, where the X-value doesn't have any bearing.
Add a ValueMarker to the range axis for each y-value you would like to draw a horizontal line.
paololim wrote:The lines also would not have a separate legend from all the other series lines.
You will need to create a custom LegendItem for each and add it to the chart's LegendItemCollection.
Richard West
Design Engineer II
Advanced Micro Devices
Sunnyvale, CA

Locked