|How (and when) to choose the scale of figures [message #700974]
||Sun, 24 July 2011 11:00
Registered: April 2010
I'm new to GEF and I'm trying to use it to develop some interactive charts. I have several different kinds of chart but they all share the feature that some of the figures are sized in proportion to an attribute of the corresponding model. The charts typically have several different kinds of figure that should use the same scale (model units/graphics units).|
The problem I have is that different parts of the chart use different EditPart and LayoutManager instances but I need to know about all of the figures that go into the scale calculation before I can set the scale. I'd like to keep the EditParts and LayoutManagers reasonably independent of each other to allow reuse across the different kinds of chart and avoid a monolithic chart EditPart.
The attachment shows the simplest of the charts, the blue bars represent data streams, the width of the bars should be proportional to the data rate of the streams, the chart also contains a higher level grouping of data streams into data services (green bars), and a data rate axis. All these sets of figures should be shown at the same X scale. Some of the charts need scaling in the X axis only, some also scale in the Y axis.
My intention is to choose the initial scale of the figures so that the figure that requires the largest scale to meets its minimum size requirement sets the scale for the whole chart. So in the attached example, the scale needed to show the label of stream 1 would set the scale of the other streams, the services and the axis figure.
So three questions:
1. What's the best place in the code that builds the EditPart and Figure trees to get information about the whole figure tree, or at least some subtree that contains all the figures that need to share a common scale.
2. Once I've worked out the scale to use, how should I push that scale information down into layout managers?
3. Is there a better way to do this? Especially one that allows me to reuse components of the charts.
Powered by FUDForum
. Page generated in 0.08956 seconds