Hi Tom. To do that you should ditch the top level columnSet, put your two sub-column sets directly in a CartesianChart, and manage the offset and columnWidthRatio properties yourself. As an example, if you want each stack to be a quarter width of the column with a quarter-width gap between them, you'd do something like:<ColumnSet offset="-.375" columnWidthRatio=".25" >...</><ColumnSet offset=".375" columnWidthRatio=".25">...</>A while back I worked out some equations for what these values should be based on your desired width/gap, but I can't remember off the top of my head. They should be in the group archives if you do some creative searching.Ely.
From: [EMAIL PROTECTED]ups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Tom Fitzpatrick
Sent: Wednesday, September 06, 2006 9:03 AM
To: [EMAIL PROTECTED]ups.com
Subject: [flexcoders] Spacing stacked columnsIn a Cartesian chart, I have defined two stacked Column Sets that each
contain two ColumnSeries. These two ColumnSets are contained in a
ColumnSet with type set to "clustered".
Kind of like this:
<mx:CartesianChart>
<mx:series>
<mx:ColumnSet type="clustered" >
<mx:ColumnSet type="stacked">
<mx:ColumnSeries yField="revenue" />
<mx:ColumnSeries yField="overhead" />
</mx:ColumnSet>
<mx:ColumnSet type="stacked" >
<mx:ColumnSeries yField="costs" />
<mx:ColumnSeries yField="oneTime"/>
</mx:ColumnSet>
</mx:ColumnSet>
</mx:series>
</mx:CartesianChart>
This is working fine.
What I'd like to do is put a space between each pair of stacked columns,
whose edges are now touching. It appears that the properties "offset"
and "columnWidthRatio" are available on the stacked ColumnSets, but I've
tried various combinations and can't make it work.
How can I calculate and set the column spacing in this situation?
- Tom
__._,_.___
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Software development tool Software development Software development services Home design software Software development company
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe
__,_._,___
- RE: [flexcoders] Spacing stacked columns Ely Greenfield
- Re: [flexcoders] Spacing stacked columns Brendan Meutzner
- Re: [flexcoders] Spacing stacked columns Tom Fitzpatrick
Reply via email to
Too lazy to figure out how to find link to groups message in Gmail, so here's the message you're referring to...
Hi Ben. When a set of column series is clustered, the
chart (or columnSet) is setting the columnWidthRatio and offset properties to do
it. So if you wanted to cluster differently, you could put the columnSeries
inside a CartesianChart and set those properties yourself.
To figure out how wide each column should be, you first
need to decide how wide you want the total cluster to be, and how much each
column should overlap. Then your formula would be:
columnWidth =
clusterWidth / (overlap + (series count)*(1-overlap));
the offset is the offset of the middle of the column
from the middle of the category. given the clusterWidth and columnWidthRatio,
the offset for each series is:
seriesOffset(N) = -clusterWidth/2 +
(1-overlap)*columnWidthRatio*(N) +
columnWidthRatio/2;
So if you have three series, and your total width is 75%,
and the overlap should be 50%, then
columnWdithRatio = .75 / (.5 + 3*(1-.5))
columnWdithRatio = .75 /
2;
columnWdithRatio
= .375
given that,
seriesOffset(0) = -.75/2 + (.5)*.375*0 +
.375/2;
seriesOffset(0) =
-.1875;
seriesOffset(1) = -.75/2 + (.5)*.375*1 +
.375/2;
seriesOffset(1) = 0;
seriesOffset(2) = -.75/2 + (.5)*.375*2 +
.375/2;
seriesOffset(2) = -.75/2 + .375 +
.375/2;;
seriesOffset(2) =
.1875;
Putting that into practice, the markup would
be
<CartesianChart>
<series>
<ColumnSeries
columnWidthRatio=".375" offset="-.1875" />
<ColumnSeries
columnWidthRatio=".375" offset="0" />
<ColumnSeries columnWidthRatio=".375"
offset=".1875" />
</CartesianChart>
(You may need to reverse the order of those, I don't
remember)
Ely.
On 9/6/06, Ely Greenfield <
[EMAIL PROTECTED]> wrote: