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
 QCChart2D for Java
 Zooming multiple graphs
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic   

swhite

5 Posts

Posted - 05 Aug 2005 :  18:59:21  Show Profile  Reply with Quote
I have subclassed ChartView and am currently displaying two charts that occupy different areas of the screen. Their layout is controlled by using setGraphBorderDiagonal(), rather than any of the standard Java layout mechanisms.

My question is how to apply zooming to the graphs so that they can be controlled independently... In other words, if I trace out a zoom area on graph 1, then I only want graph 1 to zoom and not graph 2. Is that possible? Can I use the superzooming possibility and override the mouseReleased method to catch the location of the required zoom area? How do I identify the rectangle to zoom and which chart object to apply it to? (So far I have managed to zoom either *all* the charts or *none* of them!)

Or does this not work unless I have multiple ChartView objects, each containing a single chart and monitored by a simple ChartZoom listener?

By the way, although I am currently testing the mechanisms using just two charts, the technique applied in the solution should work with up to 24 charts (preferably all in the same ChartView)

Your help would be much appreciated

Simon

swhite

5 Posts

Posted - 06 Aug 2005 :  05:44:29  Show Profile  Reply with Quote
I've been thinking about this issue some more. My current belief, and tell me if I'm wrong, is that you can't have multiple independent zooming abilities for different areas of the same ChartView, as you would need to maintain different zoom stacks. Although superzooming allows you to zoom on multiple scales, it only needs one zoom stack.

Based on this reasoning, I think I'm going to create multiple ChartView objects and lay them out using a traditional Java layout manager (probably a GridLayout). That way, they can be zoomed independently.
Go to Top of Page

quinncurtis

1164 Posts

Posted - 07 Aug 2005 :  14:24:07  Show Profile  Reply with Quote
You are right, for exactly the reasons you give.

While you could come up with a way to support zooming multiple independent charts in a single ChartView, you would need to provide a way for selecting the "active" chart, with a radio button or something like that. Selecting the chart, would install the zoom mouse listener for that PhysicalCoordinate system using simple zooming. Zooming would then only apply to the PhysicalCoordinate system of that chart, others would not be affected. If you maintain a separate ChartZoom object for every graph, you could probably maintain a zoom stack for each (I think).


If you want to go directly to any chart and zoom directly, without any other pre-selection mechanism, then using separate ChartView's, one for each chart, organized using a grid layout, is the way to go. Based on what you've said so far, that's what we recommend.

Go to Top of Page

swhite

5 Posts

Posted - 10 Aug 2005 :  05:48:00  Show Profile  Reply with Quote
quote:

While you could come up with a way to support zooming multiple independent charts in a single ChartView, you would need to provide a way for selecting the "active" chart, with a radio button or something like that.



Thanks for your reply, and confirmation of my reasoning.

I wouldn't want the user to have to choose which chart to zoom with a radio button or other control, as using the mouse pointer on the chart is, from the user's point of view, already sufficient indication of which chart to zoom. Maybe there is a mechanism by which a mouselistener can listen to the position of the mouse to activate the corresponding zoom listener....?

In any case, I've gone for separate chart views and a Java layout manager. So far, so good...
Go to Top of Page
  Previous Topic Topic   
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07