How to add scroll bar?

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

How to add scroll bar?

Post by Sudha Sundaram » Tue Mar 13, 2001 11:03 pm

I would like a scroll bar to appear besides the vertical bar plot,
since I have too many bars on my plot (so that the bars will have an uniform size). Is this possible?

thanks
Sudha

David Gilbert

RE: How to add scroll bar?

Post by David Gilbert » Thu Mar 15, 2001 1:25 pm

Hi Sudha,

I haven't tried this, but you should be able to embed a JFreeChartPanel within a JScrollPane to get scroll bars for the chart as a whole - this would solve your problem of too many bars for the available space, but I guess the chart titles etc might scroll away also!

Setting scrollbars for just the plot area is more of a problem, since JFreeChart draws to a Graphics2D object - that might represent the printer, the screen, or an image in memory. So for this general case, adding scrollbars is a problem.

I'm open to ideas for workarounds...

Regards,

DG.

Locked