Your (a) thought looks like a likely candidate. CategoryAxis objects
don't inherit their dataprovider from the chart...you need to assign
them explicitly.
Ely.
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of dave buhler
Sent: Saturday, August 27, 2005 2:34 PM
To: [email protected]
Subject: [flexcoders] Charting Components w/in Repeater
Importance: High
I am unable to get the Charting Component to Work within a Repeater.
Here is what I am doing:
------------------------------------------------------------------------
----------
1) The information being returned from Coldfusion is returned as a
struct Result (object #2)
.....AUTHORCOUNT: 13
.....RATEDCOUNT: 1
.....GETRATINGSFEEDBACK (object #3)
.......[0] (object #4)
...............DELIVERY: 5
...............PAYMENT: 2
...............QUALITY: 4
...............R_ID: 14337
.......[1] (object #6)
...............DELIVERY: 3
...............PAYMENT: 0
...............QUALITY: 4
...............R_ID: 2732
------------------------------------------------------------------------
----------
2) I take this struct/object and convert it to an array of named
objects:
arrChart = [];
for ( var i in event.result.GETRATINGSFEEDBACK ){
arrChart.push(
{delivery:event.result.GETRATINGSFEEDBACK[i].DELIVERY
,
payment:event.result.GETRATINGSFEEDBACK[i].PAYMENT
,
quality:event.result.GETRATINGSFEEDBACK[i].QUALITY} ); }
------------------------------------------------------------------------
----------
3) Then, I populate the repeater's forms within the repeater:
view.rptRatings.dataProvider = event.result.GETRATINGSFEEDBACK;
------------------------------------------------------------------------
----------
4) When the repeater fires each (creationComplete event), I pass the
repeater's index to a function that attempts to set the current chart
being created with the object (delivery, payment, quality) in the X
position of the array initalized earlier.
public function setChart ( index : Number ) : Void {
var i = index
view.rptRatings[i].idChart.dataProvider = arrChart[i];
// is is showing the right index.....
// arrChart[i].delivery is showing the right value }
------------------------------------------------------------------------
----------
5) Then, I rub Buddah's belly and attempt to create the chart, but
nothing happens.
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.macromedia.com/2003/mxml"
xmlns:ratings="com.mydomain.source.view.profiles.ratings.*"/>
<ratings:RatingsViewHelper
id="ratingsViewHelper" />
<mx:Repeater id="rptRatings" >
<!-- //////////////////////////// CHART //////////////////////////// -->
<mx:BarChart id="idChart"
width="100%"
height="100%"
type="stacked"
creationComplete="ratingsViewHelper.setChart(
event.target.repeaterIndices[0] )">
<mx:verticalAxis>
<mx:CategoryAxis name="Project
Ratings" categoryField="arrChart" />
</mx:verticalAxis>
<mx:series>
<mx:Array>
<mx:BarSeries
xField="delivery" name="Delivery"/>
<mx:BarSeries
xField="payment" name="Payment"/>
<mx:BarSeries
xField="quality" name="Quality"/>
</mx:Array>
</mx:series>
</mx:BarChart>
</mx:Repeater>
</mx:VBox>
------------------------------------------------------------------------
----------
My only thoughts as to possible problems would center on:
a) the categoryField has no object (strings or array of objects) being
assigned to it.
b) I am failing to reference the dataProvider(s) correctly. The
categoryAxis throws an error when compiled if I assign it an ID, so I
see no way to reference it programatically.
Any assistance is welcome.
Dave
------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~->
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~->
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/