Adobe Dreamweaver Forums



Last 10 THreads :         Load dynamic text into an embeded swf (Last Post : mikeyjray - Replies : 4 - Views : 9 )           »          Log email text (Last Post : Torgom - Replies : 0 - Views : 1 )           »          Properties > Flex Build Path (Last Post : kevxross - Replies : 0 - Views : 1 )           »          Can Anyone Help With Sub Menus (Last Post : Murray *ACE* - Replies : 8 - Views : 9 )           »          transferring DW license from crashed computer (Last Post : Sonjay - Replies : 1 - Views : 7 )           »          DIV in Table not working. (Last Post : Murray *ACE* - Replies : 13 - Views : 14 )           »          Variable for Loader Content (Last Post : Sea Crystal - Replies : 0 - Views : 1 )           »          left join won't work in query of query? (Last Post : Dan Bracuk - Replies : 5 - Views : 6 )           »          fireworks exports hundreds of files (Last Post : Rob Miller - Replies : 0 - Views : 1 )           »          Fireworks Color Selection Bug (Last Post : Linda Rathgeber - Replies : 3 - Views : 4 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 12-01-2008, 04:03 PM
shawn.yale
 
Posts: n/a
Diggs:
Default Flex Charting: Removing Duplicate Categories

In line with my previous post regarding charts, I have a data set that I need
to group into categories. When I create my chart, Im getting duplicate labels
on the axis for the category. I need to only have one group for each category.

So for example:
{name:"Red', value:1, other:"Happy"},
{name:"Red', value:1, other:"Sad"},
{name:"Red', value:1, other:"Glad"},
{name:"Blue', value:1, other:"Happy"},
{name:"Blue', value:1, other:"Sad"},
{name:"Blue', value:1, other:"Glad"}

I want a group on my chart for all of the Red items, and one for all of the
blue items but what Im getting back is 3 red labels and 3 blue labels.

Can flex charts not combine these into a single label item?

Thanks



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-01-2008, 04:23 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Flex Charting: Removing Duplicate Categories


"shawn.yale" <syale@triad.rr.com> wrote in message
news:gh11cj$ht9$1@forums.macromedia.com...
> In line with my previous post regarding charts, I have a data set that I
> need
> to group into categories. When I create my chart, Im getting duplicate
> labels
> on the axis for the category. I need to only have one group for each
> category.
>
> So for example:
> {name:"Red', value:1, other:"Happy"},
> {name:"Red', value:1, other:"Sad"},
> {name:"Red', value:1, other:"Glad"},
> {name:"Blue', value:1, other:"Happy"},
> {name:"Blue', value:1, other:"Sad"},
> {name:"Blue', value:1, other:"Glad"}
>
> I want a group on my chart for all of the Red items, and one for all of
> the
> blue items but what Im getting back is 3 red labels and 3 blue labels.
>
> Can flex charts not combine these into a single label item?


Look at GroupingCollections and assign one group to each series.

HTH;

Amy


Reply With Quote
  #3 (permalink)  
Old 12-01-2008, 04:33 PM
shawn.yale
 
Posts: n/a
Diggs:
Default Re: Flex Charting: Removing Duplicate Categories

do grouping collections work with column charts?
i havent been able to get them to work.

Reply With Quote


  #4 (permalink)  
Old 12-01-2008, 04:33 PM
shawn.yale
 
Posts: n/a
Diggs:
Default Re: Flex Charting: Removing Duplicate Categories

do grouping collections work with column charts?
i havent been able to get them to work.

Reply With Quote
  #5 (permalink)  
Old 12-01-2008, 05:33 PM
shawn.yale
 
Posts: n/a
Diggs:
Default Re: Flex Charting: Removing Duplicate Categories

do grouping collections work with column charts?
i havent been able to get them to work.

Reply With Quote
  #6 (permalink)  
Old 12-01-2008, 05:33 PM
shawn.yale
 
Posts: n/a
Diggs:
Default Re: Flex Charting: Removing Duplicate Categories

Can someone post an example of how to use grouping collections in the manner Ive described?

ill owe you a beer.
Reply With Quote


  #7 (permalink)  
Old 12-01-2008, 05:43 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Flex Charting: Removing Duplicate Categories


"shawn.yale" <syale@triad.rr.com> wrote in message
news:gh13je$kid$1@forums.macromedia.com...
> do grouping collections work with column charts?
> i havent been able to get them to work.
>


I would think that setting the series dataprovider to something like this:
yourGroupingCollection.getRoot().getItemAt(someInd ex).children

should work.

What have you tried?


Reply With Quote
  #8 (permalink)  
Old 12-01-2008, 06:24 PM
shawn.yale
 
Posts: n/a
Diggs:
Default Re: Flex Charting: Removing Duplicate Categories

Ive tried both the grouping collection and the column set and neither seems to
be working correctly.

I try to pull from my xml collection like this:

[Bindable]
private var xml2:XML=
<root>
<AnnualItem processLabel="Red">
<item interval="Y2005" score="4.5"/>
<item interval="Y2006" score="3.5"/>
<item interval="Y2007" score="1.5"/>
</AnnualItem>
<AnnualItem processLabel="Green">
<item interval="Y2005" score="2.5"/>
<item interval="Y2006" score="4.5"/>
<item interval="Y2007" score="4.5"/>
</AnnualItem>
<AnnualItem processLabel="Yellow">
<item interval="Y2005" score="1.5"/>
<item interval="Y2006" score="2.5"/>
<item interval="Y2007" score="4.5"/>
</AnnualItem>
</root>;


<mx:ColumnChart x="10" y="48" id="columnchart1" columnWidthRatio=".4"
showDataTips="true">

mx:GroupingCollection source="{xml2.AnnualItem}" id="gcl" childrenField="item">

<mx:Grouping>
<mx:GroupingField name="processLabel"/>
</mx:Grouping>
</mx:GroupingCollection>

<mx:horizontalAxis>
<mx:CategoryAxis dataProvider="{gcl}" categoryField="processLabel"/>
</mx:horizontalAxis>

<mx:series>
<mx:ColumnSeries dataProvider="{gcl}" yField="score" xField="interval"/>
</mx:series>

I want to group my items in order by category.

So on my axis I want one "Red" category with 3 different column bars. Each
column bar should represent 1 of the item values from the xml.

then I want one "Green" category with the correct values.

and then one "Yellow" category.

As an aside:
Whenever I do get something to work, the chart renders all of the column bars
the same height.

When I try the above, I get an error stating that the groupingCollection does
not have a value of "score."

there has got to be an easy way to display this data. At least I would think.

Thank you for looking at this.

Reply With Quote
  #9 (permalink)  
Old 12-01-2008, 07:50 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Flex Charting: Removing Duplicate Categories


"shawn.yale" <syale@triad.rr.com> wrote in message
news:gh19qf$s3h$1@forums.macromedia.com...
> Ive tried both the grouping collection and the column set and neither
> seems to
> be working correctly.
>
> I try to pull from my xml collection like this:
>
> [Bindable]
> private var xml2:XML=
> <root>
> <AnnualItem processLabel="Red">
> <item interval="Y2005" score="4.5"/>
> <item interval="Y2006" score="3.5"/>
> <item interval="Y2007" score="1.5"/>
> </AnnualItem>
> <AnnualItem processLabel="Green">
> <item interval="Y2005" score="2.5"/>
> <item interval="Y2006" score="4.5"/>
> <item interval="Y2007" score="4.5"/>
> </AnnualItem>
> <AnnualItem processLabel="Yellow">
> <item interval="Y2005" score="1.5"/>
> <item interval="Y2006" score="2.5"/>
> <item interval="Y2007" score="4.5"/>
> </AnnualItem>
> </root>;


You don't need a GroupingCollection with this dataSet, as it is already
grouped. Just assign each series's dataProvider to a different AnnualItem.

HTH;

Amy


Reply With Quote


  #10 (permalink)  
Old 12-01-2008, 07:55 PM
shawn.yale
 
Posts: n/a
Diggs:
Default Re: Flex Charting: Removing Duplicate Categories

Thank you for all your help Amy!
I set this xml up to make the grouping easier.
My actual xml isnt grouped like this.
Its more like

<interval:2007, processLabel:"Red", score:1.5/>
<interval:2007, processLabel:"Green", score:4.5/>
<interval:2007,processLabel:"Green", score:3.5/>
<interval:2007,processLabel:"Yellow", score:3.5/>
<interval:2006, processLabel:"Red", score:4.5/>


Unfortunately, its still not working. When I trace through my
groupingCollection (even in actionscript) I don't see any changes to my data.
These are the only values in my groupingcollection:

dsGroupColl = mx.collections.GroupingCollection (@76b5761)
childrenField = "children"
grouping = mx.collections.Grouping (@7b09cb9)
compareFunction = null
fields = Array (@7b0e389)
[0] = mx.collections.GroupingField (@7b0e351)
caseInsensitive = false
compareFunction = null
descending = false
groupingFunction = null
groupingObjectFunction = null
name = "processLabel"
numeric = false
summaries = null
length = 1
groupingObjectFunction = null
label = "GroupLabel"
optimizeSummaries = false
source = mx.collections.ArrayCollection (@78ead81)
summaries = null

There is nothing in there indicating that the list has even been grouped. I
opened the source and even that remains in the original non-grouped order.

There doesn't appear to be anything indicating any form of change.

When I bind off of the groupingCollection, as in
<mx:ColumnChart dataProvider="{groupColl}">
<mx:series>
<mx:ColumnSeries yField="score"/>
</mx:series>
</mx:ColumnChart.

I get an error stating that 'score is not a property on groupingCollection."

I guess the only thing Im going to be able to do is to create a stack of
arrays and break apart my datasource which will be awful in the way of
performance.

I dont know what else to do here. I need each of the three years values to
display separately in each of the three groups.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 11:21 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk