Let's see...
1) If you're going to use binding to assign the dataprovider, and you
want to swap in a different one at runtime, you either need to a) change
the value of the thing you're binding to, or b) don't use binding. i.e.,
you could do this:
<Script>
[Bindable] public var currentDP:Array;
public function changeDP() {
currentDP = someOtherDP;
}
// Adding a series:
Function addSeries()
{
var newSeries:ColumnSeries = new ColumnSeries();
newSeries.yField = "newYField";
chartSeries.push(newSeries);
myChart.series = chartSeries;
}
</Script>
<ColumnChart id="myChart" dataProvider="{currentDP}" >
<series>
<Array id="chartSeries">
<ColumnSeries ... />
</Array>
</series>
</ColumnChart>
I'm not sure exactly what you mean by dragging a column. You mean
drag-select a group of columns to then drag/drop? Could be done, but it
would be non-trivial work. Selection unfortunately didn't make it into
this release. But you could extend the ColumnSeries and CartesianChart
to support it.
Additional Types: Yes, in theory, although nothing specific is planned
at this point. PieChart is built on PolarChart, which could serve as
the basis for any type of Polar Coordinate based chart. Which means a
RadarSeries shouldn't be too hard to build on the shipping Flex2 charts
(think of it as a LineSeries based on a PolarChart).
Ely.
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of flexabledev
Sent: Monday, April 17, 2006 9:12 PM
To: [email protected]
Subject: [flexcoders] Re: [Flex 2b2] Changing a Chart's dataProvider at
runtime?
Change it to a different one. (See below) For example:
change dataProvider (via AS3) for summaryChart to
"{model.marketSummary}"
add a ColumnSeries where yField equals "mktQTY" and categoryField equals
"mktLabel"
Thanks Ely! Also, while I've got you...
Any suggestion on how to drag a column as a way to select a group of
data to drop?
Are there any plans for additional chart types in the future? Radar
Chart?
Martin
<mx:ColumnChart id="summaryChart"
dataProvider="{model.scoreSummary}"
showDataTips="true"
width="100%" height="45%" axisTitleStyle="axisStyle" >
<mx:horizontalAxis>
<mx:CategoryAxis
dataProvider="{model.scoreSummary}"
categoryField="scrLabel" />
</mx:horizontalAxis>
<mx:series>
<mx:Array>
<mx:ColumnSeries displayName="Leads"
yField="scrQTY" />
</mx:Array>
</mx:series>
</mx:ColumnChart>
--- In [email protected], "Ely Greenfield" <[EMAIL PROTECTED]>
wrote:
>
>
> What do you mean by change the dataProvider? Modify it? Or change to a
> different one?
>
>
> And if you can give an example of how you're setting the series in the
> first place, I can give help adding a new one.
>
> Ely.
>
>
>
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED]
> On Behalf Of flexabledev
> Sent: Monday, April 17, 2006 6:38 PM
> To: [email protected]
> Subject: [flexcoders] [Flex 2b2] Changing a Chart's dataProvider at
> runtime?
>
> Can someone give me a real quick example (Flex 2 B2 please) on how to
> change the dataProvider and adding a series to a Chart at runtime? It
> seems to have changed from Flex 1.5 and other than changing the
> yField of series for an existing dataProvider, I can't find a good
> example in the docs. Thanks in advance...
>
>
>
>
>
>
>
> --
> 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
>
--
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
--
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/