<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Interactive Charting Legend to select which series to display</title>
	<atom:link href="http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/</link>
	<description></description>
	<lastBuildDate>Wed, 10 Mar 2010 14:12:31 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: hng</title>
		<link>http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/comment-page-1/#comment-643</link>
		<dc:creator>hng</dc:creator>
		<pubDate>Tue, 06 Oct 2009 03:55:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/#comment-643</guid>
		<description>Thank you so much for the post, Kyle. My project needs just the same thing.

I modified your code a little bit to use in a separate AS file for any chart type:

private function clickLegend(event:LegendMouseEvent, chart:ChartBase):void {
  var ser:Series = findSeries(event.item.label, chart);
  if(ser != null) {
    ser.visible = (event.item as myLegendItem).selected;
  }
}

private function findSeries(lbl:String, chart:ChartBase):Series {
  for(var i:int = 0; i &lt; chart.series.length;i++) {
    if(chart.series[i].displayName == lbl) {
      return chart.series[i];
    }
  }

  return null;
}</description>
		<content:encoded><![CDATA[<p>Thank you so much for the post, Kyle. My project needs just the same thing.</p>
<p>I modified your code a little bit to use in a separate AS file for any chart type:</p>
<p>private function clickLegend(event:LegendMouseEvent, chart:ChartBase):void {<br />
  var ser:Series = findSeries(event.item.label, chart);<br />
  if(ser != null) {<br />
    ser.visible = (event.item as myLegendItem).selected;<br />
  }<br />
}</p>
<p>private function findSeries(lbl:String, chart:ChartBase):Series {<br />
  for(var i:int = 0; i &lt; chart.series.length;i++) {<br />
    if(chart.series[i].displayName == lbl) {<br />
      return chart.series[i];<br />
    }<br />
  }</p>
<p>  return null;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mayuresh</title>
		<link>http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/comment-page-1/#comment-634</link>
		<dc:creator>Mayuresh</dc:creator>
		<pubDate>Mon, 21 Sep 2009 19:11:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/#comment-634</guid>
		<description>I found a solution to my problem. You have to manually arrange all child components, by setting thier x,y co-ordinates specifically.
Please let me know if there is a better solution.</description>
		<content:encoded><![CDATA[<p>I found a solution to my problem. You have to manually arrange all child components, by setting thier x,y co-ordinates specifically.<br />
Please let me know if there is a better solution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mayuresh</title>
		<link>http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/comment-page-1/#comment-633</link>
		<dc:creator>Mayuresh</dc:creator>
		<pubDate>Mon, 21 Sep 2009 17:57:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/#comment-633</guid>
		<description>I am trying to add a checkbox to the Legend.
And instead of adding a canvas and making the background green, I want to show the checkbox selected.

My problem is when try to add a child (checkbox) in the createChildren() method the checkbox is placed above the legend Marker.

I want all 3 of them (check box, legend Marker (colour box) and the Name ) to be in a row..

Can anyone sugget a way to achieve this</description>
		<content:encoded><![CDATA[<p>I am trying to add a checkbox to the Legend.<br />
And instead of adding a canvas and making the background green, I want to show the checkbox selected.</p>
<p>My problem is when try to add a child (checkbox) in the createChildren() method the checkbox is placed above the legend Marker.</p>
<p>I want all 3 of them (check box, legend Marker (colour box) and the Name ) to be in a row..</p>
<p>Can anyone sugget a way to achieve this</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: scho</title>
		<link>http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/comment-page-1/#comment-551</link>
		<dc:creator>scho</dc:creator>
		<pubDate>Fri, 06 Mar 2009 12:14:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/#comment-551</guid>
		<description>Great example, but your code doesn&#039;t work, when you click at a legend symbol. The following code solved this issue:



private function clickLegend(event:MouseEvent):void{
				for each(var legendItem:CustomLegendItem in legend.getChildren()){
					var series:Series = findSeries(legendItem.label);
					series.visible = legendItem.selected;
				}
            }</description>
		<content:encoded><![CDATA[<p>Great example, but your code doesn&#8217;t work, when you click at a legend symbol. The following code solved this issue:</p>
<p>private function clickLegend(event:MouseEvent):void{<br />
				for each(var legendItem:CustomLegendItem in legend.getChildren()){<br />
					var series:Series = findSeries(legendItem.label);<br />
					series.visible = legendItem.selected;<br />
				}<br />
            }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/comment-page-1/#comment-490</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Tue, 30 Dec 2008 06:43:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/#comment-490</guid>
		<description>Thanks Kyle for the great example. A slight correction to ryan solution:

var lineSer:LineSeries = event.item.element as LineSeries;

I also found the following (using source insteaad of element) produces same results although I am not sure which one is more safer

var lineSer:LineSeries = event.item.source as LineSeries;</description>
		<content:encoded><![CDATA[<p>Thanks Kyle for the great example. A slight correction to ryan solution:</p>
<p>var lineSer:LineSeries = event.item.element as LineSeries;</p>
<p>I also found the following (using source insteaad of element) produces same results although I am not sure which one is more safer</p>
<p>var lineSer:LineSeries = event.item.source as LineSeries;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ryan</title>
		<link>http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/comment-page-1/#comment-436</link>
		<dc:creator>ryan</dc:creator>
		<pubDate>Wed, 12 Nov 2008 21:59:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/#comment-436</guid>
		<description>Actually, perhaps this is not news, but rather than having the findSeries function, which is liable to causing problems in the case that legend items have the same display name, you can change:

var lineSer:LineSeries = findSeries(event.item.label);

to:

var lineSer:LineSeries = event.item.element as Series;

This is a much more direct means, and less prone to errors. Hope this helps.</description>
		<content:encoded><![CDATA[<p>Actually, perhaps this is not news, but rather than having the findSeries function, which is liable to causing problems in the case that legend items have the same display name, you can change:</p>
<p>var lineSer:LineSeries = findSeries(event.item.label);</p>
<p>to:</p>
<p>var lineSer:LineSeries = event.item.element as Series;</p>
<p>This is a much more direct means, and less prone to errors. Hope this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomas</title>
		<link>http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/comment-page-1/#comment-294</link>
		<dc:creator>Tomas</dc:creator>
		<pubDate>Mon, 22 Sep 2008 20:46:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/#comment-294</guid>
		<description>Very nice.  Thanks for posting the code.  Shows me how much there is to learn about getting into the guts of Flex.  Cheers.</description>
		<content:encoded><![CDATA[<p>Very nice.  Thanks for posting the code.  Shows me how much there is to learn about getting into the guts of Flex.  Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ofir</title>
		<link>http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/comment-page-1/#comment-119</link>
		<dc:creator>Ofir</dc:creator>
		<pubDate>Tue, 06 May 2008 11:42:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/#comment-119</guid>
		<description>hi Kyle,
http://shemesh.wordpress.com/2008/05/06/22/</description>
		<content:encoded><![CDATA[<p>hi Kyle,<br />
<a href="http://shemesh.wordpress.com/2008/05/06/22/" rel="nofollow">http://shemesh.wordpress.com/2008/05/06/22/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shemesh Spots</title>
		<link>http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/comment-page-1/#comment-118</link>
		<dc:creator>Shemesh Spots</dc:creator>
		<pubDate>Tue, 06 May 2008 11:36:59 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/#comment-118</guid>
		<description>[...] Some while ago Kyle posted on his blog an article about interactive legend. [...]</description>
		<content:encoded><![CDATA[<p>[...] Some while ago Kyle posted on his blog an article about interactive legend. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew Horn</title>
		<link>http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/comment-page-1/#comment-82</link>
		<dc:creator>Matthew Horn</dc:creator>
		<pubDate>Wed, 12 Mar 2008 15:07:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.flexmonkeypatches.com/2008/03/10/interactive-charting-legend-to-select-which-series-to-display/#comment-82</guid>
		<description>Very cool! Wish I had written it. :)

matt horn
flex docs</description>
		<content:encoded><![CDATA[<p>Very cool! Wish I had written it. <img src='http://blog.flexmonkeypatches.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>matt horn<br />
flex docs</p>
]]></content:encoded>
	</item>
</channel>
</rss>
