Problem with scrolling bar charts

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

Problem with scrolling bar charts

Post by Horst Loch » Tue Nov 20, 2001 9:59 am

Hallo !

If I put a JFreeChartPanel in a JSrollPane it works not correct. The bars are drawn outside of the border of the JFreeChartPanel. This happens only if the scroll bars appears and if the scroll bars are moved.
Is there any solution or suggestion to make a bar chart scrollable ?

David Gilbert

RE: Problem with scrolling bar charts

Post by David Gilbert » Tue Nov 20, 2001 10:15 pm

Hi Horst,

It's very likely a problem with the JFreeChartPanel class. I'll try out the scroll pane tomorrow and see if I can figure it out.

DG.

David Gilbert

RE: Problem with scrolling bar charts

Post by David Gilbert » Tue Nov 20, 2001 10:49 pm

Actually, it's not a problem with JFreeChartPanel. It's a bug in the HorizontalBarPlot and VerticalBarPlot classes, which I managed to replicate and fix just now. If you find the line:

g2.setClip(plotArea)

in the draw(...) method just before the bars are plotted, and change it to:

g2.clip(plotArea);

then the plot should work inside a JScrollPane (it does for me!).

Thanks for reporting the bug...

Regards,

DG.

Locked