![]() |
![]() |
||||||
|
|||||||
| Tags: |
![]() |
|
|||
|
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 |
| Sponsored Links |
|
|||
|
"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 |
|
|||
|
"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? |
|
|||
|
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. |
|
|||
|
"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 |
|
|||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise