Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Java
 QCRTGraph for Java
 Meter Resizing
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

RunnerGirl

6 Posts

Posted - 26 Mar 2007 :  14:05:12  Show Profile  Reply with Quote
I have created five meters and added them the the ChartView with three in one row and two in the second row. When I manually resize the panel to be much wider than tall, the meters overlap. Is there a way to avoid this?

Thanks

quinncurtis

1586 Posts

Posted - 26 Mar 2007 :  14:51:46  Show Profile  Reply with Quote
Meters will always stay round, and will not change aspect ratio (i.e. become elliptical) regardless of what you do to the parent window. The radius of a meter is defined by its width. So if you start reducing the height of the parent window, the height of the meter will start to use a greater and greater percentage of the parent ChartView window. That is what would cause an overlap.

If you are going to use objects that require a fixed aspect ratio, i.e. round things like meters, you are going to have to restrict the resize capability of the parent window to a fixed aspect ratio, and only allow resizing to a fixed ratio of height:width. This is very common with image files, since changing the aspect ratio of a bitmap image file is often undesirable. The best place to do this would be to control the size of the JPanel object the ChartView is placed in.

Or you could use indicator objects (bars) that do not require a fixed aspect ratio. Keep in mind that drastically changing the aspect ratio of any graph will generally render the chart so ugly as to be useless.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07