ChartComposite with zoom rectangle

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
rupi
Posts: 8
Joined: Thu May 07, 2009 1:38 pm

ChartComposite with zoom rectangle

Post by rupi » Wed Jun 01, 2016 8:02 pm

I have a chartcomposite with a range zooming turned off and domain zooming turned on. The code is

chartComposite.setRangeZoomable(false);
chartComposite.setDomainZoomable(true);

As seen in the image below the zoom rectangle shows up fine.

Image

But when I make the chart window smaller, the zoom rectangle shows up incorrectly as shown below. Any pointers to why this is happening ? This does not happen when using AWT ChartPanel.

Image

rupi
Posts: 8
Joined: Thu May 07, 2009 1:38 pm

Re: ChartComposite with zoom rectangle

Post by rupi » Thu Jun 02, 2016 1:12 pm

I was able to solve my own problem. Turns out that ChartComposite has a constructor that is much more complex but allows you to set the minimum chart height and width. Using that with a minimum height of 0 solved this problem.

Locked