The devil's in the details, but here'so one way to get what you're
looking for....

1) write a custom renderer for your column series.
2) the renderer should add a mouseDown handler to itself. On mousedown,
it should redraw itself with a different color (to give click feedback)
and do boilerplate mouse tracking to reset when the mouse is released.
3) on mouseDown, the renderer should add a mouseMove handler to itself.
When the mouse has moved some minimum number of pixels, it should call a
method to trigger a drag begin
4) in that method it calls the DragManager to initiate a drag operation.
It passes its item (this.chartItem.item) as the data being dragged, and
itself  originating object. That would get a drag image that matches the
column.



Regarding writing a custom renderer...there's probably not a lot of
people out there who have experience with this at this point.  You could
try Macromedia consulting..they've done more custom chart work that
anyone at this point...Or there's a bunch of people who have enough
experience with flex that writing this level of custom work shouldn't be
too difficult, with enough questions posted to flexcoders ;)


Ely.

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of flexabledev
Sent: Tuesday, April 18, 2006 11:50 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: [Flex 2b2] Changing a Chart's dataProvider at
runtime?

Thanks Ely, That really helps!

Re: Dragging a column - Let me try to describe what I am trying to
accomplish:

Imagine a DataGrid with potentially thousands of rows (paged via data
services) and maybe 10 columns. Below the DataGrid is a Column Chart.
 Below the Column Chart is a row of images/buttons, with labels like "by
Market", "by Title", "by Revenue", etc.  Click on a image/button and the
Chart above renders a summary of the data in the DataGrid by one of it's
columns (Market, Title, Revenue, etc.) A user can either Select rows
from the DataGrid or a Column (representing a group of rows from the
DataGrid where Column value equals category of Chart) and drag them to a
shopping cart in order to purchase. For Example: a user could select
individual rows from the DataGrid or select the "Telecom" Column on the
"by Market" Chart which would represent all rows in the DataGrid where
the value in the "Market" column equals
"Telecom".   Does this make sense?

Re: New Chart Types - Where would I find someone that I can engage
(pay) to build a new Chart type, or modify an existing renderer?  Not a
big project I presume, and I'm finding that many firms are not
interested in small projects like that...

--- In flexcoders@yahoogroups.com, "Ely Greenfield" <[EMAIL PROTECTED]>
wrote:
>
> 
> 
> 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: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
> On Behalf Of flexabledev
> Sent: Monday, April 17, 2006 9:12 PM
> To: flexcoders@yahoogroups.com
> 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 flexcoders@yahoogroups.com, "Ely Greenfield" <egreenfi@>
> 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: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
> > On Behalf Of flexabledev
> > Sent: Monday, April 17, 2006 6:38 PM
> > To: flexcoders@yahoogroups.com
> > 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



 




--
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/
 


Reply via email to