on charts, itemRenderers are styles, of type IFactory.  so you want to do this:
 
import mx.charts.renderers.DiamondItemRenderer;
 
...
columnSeries.setStyle("itemRenderer",new ClassFactory(DiamondRenderer));
 
Ely.
 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of j_sevlie
Sent: Friday, August 25, 2006 1:00 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Specifying LineSeries itemRenderer with Actionscript

I have some LineSeries charts that are generated all through
ActionScript (because the number of lines I need is not know until
run-time).

--- CODE START ---
var seriesArray:Array = new Array();
var i:int;
var marketShareData:ArrayCollection = new ArrayCollection;

marketShareData = wsData.getMarketShare.lastResult;

for(i=0; i<marketShareData.length; i++) {
// Line for brand-specific data
var columnSeries:ColumnSeries = new ColumnSeries();
columnSeries.xField = "fiscalyear";
columnSeries.yField = "sharepercentage";
columnSeries.dataProvider = marketShareData.getItemAt(i);
columnSeries.displayName =
marketShareData.getItemAt(i).getItemAt(0).series;
seriesArray.push(columnSeries);
}
columnchartMarketShare.dataProvider = marketShareData;
columnchartMarketShare.series = seriesArray;
--- CODE END ---

My question is: How in the world do I specify a custom itemRenderer
through Actionscript? With MXML you can do it like this:

<LineSeries yField="costs"
itemRenderer="mx.charts.renderers.DiamondItemRenderer"/>

But I'm not defining my LineSeries that way. I saw the demo of the
charting stuff over at QuietlyScheming.com
(http://demo.quietlyscheming.com/ChartSampler/app.html) but he's also
defining the series at design-time.

Any thoughts?

Thanks in advance for any help that somebody can provide.

Cheers,
Jacob

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to