[flexcoders] Customizing datatip function for 100% bar chart
Using Flex 2. I have a 100% bar chart that I need help figuring out how to get access to some of the series data for display in a data tip. Here's the scenario: There are 4 regions in the country, each of them gets their own bar in the chart. - North Region - South Region - West Region - East Region Each bar has 4 individual peices to it, which together sum to 100%: - Used Sales - New Sales - Parts - Accessories What I need is a way to display the name of the grouping (Used Sales, New Sales, etc) inside my datatip. I cannot for the life of me figure out how to do this. Here's the code that I'm working with: - mx:Script ![CDATA[ import mx.charts.HitData; public function dataTipsBarChart(e:HitData):String { /* so far I know how to get the region name, but how do you get the actual displayname of the series that is being rolled over? */ return e.item.region; } ]] /mx:Script mx:BarChart x=10 y=36 width=80% height=124 id=barchartDealers type=100% showDataTips=true dataTipFunction=dataTipsBarChart mx:dataProvider mx:Array mx:Object region=North newsales=50 usedsales=25 parts=15 accessories=10 / mx:Object region=South newsales=40 usedsales=35 parts=10 accessories=15 / mx:Object region=East newsales=65 usedsales=15 parts=10 accessories=10 / mx:Object region=West newsales=60 usedsales=20 parts=15 accessories=5 / /mx:Array /mx:dataProvider mx:verticalAxis mx:CategoryAxis categoryField=region displayName=/ /mx:verticalAxis mx:horizontalAxis mx:LinearAxis minimum=0 maximum=100/ /mx:horizontalAxis mx:series mx:BarSeries displayName=New Sales yField=region xField=newsales mx:fill mx:SolidColor color=0x009900/ /mx:fill /mx:BarSeries mx:BarSeries displayName=Used Sales yField=region xField=usedsales mx:fill mx:SolidColor color=0x00/ /mx:fill /mx:BarSeries mx:BarSeries displayName=Parts yField=region xField=parts mx:fill mx:SolidColor color=0xFF9900/ /mx:fill /mx:BarSeries mx:BarSeries displayName=Accessories yField=region xField=accessories mx:fill mx:SolidColor color=0xFF/ /mx:fill /mx:BarSeries /mx:series /mx:BarChart mx:Legend dataProvider={barchartDealers} x=74.5 y=151 width=522 height=31 fontSize=9 id=barchartDealersLegend/ - Any help with this would be greatly appreciated! I hope that my example was clear enough, it should run on it's own if you cut/paste it into a blank Flex app. -- 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/
RE: [flexcoders] Customizing datatip function for 100% bar chart
return Series(e.item.element).displayName; Ely. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of j_sevlieSent: Thursday, August 31, 2006 9:17 AMTo: flexcoders@yahoogroups.comSubject: [flexcoders] Customizing datatip function for 100% bar chart Using Flex 2.I have a 100% bar chart that I need help figuring out how to getaccess to some of the series data for display in a data tip. Here'sthe scenario:There are 4 regions in the country, each of them gets their own bar inthe chart..- North Region- South Region- West Region- East RegionEach bar has 4 individual peices to it, which together sum to 100%:- Used Sales - New Sales- Parts- AccessoriesWhat I need is a way to display the name of the grouping (Used Sales,New Sales, etc) inside my datatip. I cannot for the life of me figureout how to do this.Here's the code that I'm working with:-mx:Script![CDATA[import mx.charts.HitData;public function dataTipsBarChart(e:HitData):String { /*so far I know how to get the region name, but how do youget the actual "displayname" of the series that is being rolled over?*/return e.item.region;}]]/mx:Scriptmx:BarChart x="10" y="36" width="80%" height="124"id="barchartDealers" type="100%" showDataTips="true"dataTipFunction="dataTipsBarChart"mx:dataProvidermx:Arraymx:Object region="North" newsales="50" usedsales="25" parts="15"accessories="10" /mx:Object region="South" newsales="40" usedsales="35" parts="10"accessories="15" /mx:Object region="East" newsales="65" usedsales="15" parts="10"accessories="10" /mx:Object region="West" newsales="60" usedsales="20" parts="15"accessories="5" //mx:Array/mx:dataProvidermx:verticalAxismx:CategoryAxis categoryField="region" displayName=""//mx:verticalAxismx:horizontalAxismx:LinearAxis minimum="0" maximum="100"//mx:horizontalAxismx:seriesmx:BarSeries displayName="New Sales" yField="region" xField="newsales"mx:fillmx:SolidColor color="0x009900"//mx:fill/mx:BarSeriesmx:BarSeries displayName="Used Sales" yField="region"xField="usedsales"mx:fillmx:SolidColor color="0x00"//mx:fill/mx:BarSeriesmx:BarSeries displayName="Parts" yField="region" xField="parts"mx:fillmx:SolidColor color="0xFF9900"//mx:fill/mx:BarSeriesmx:BarSeries displayName="Accessories" yField="region"xField="accessories"mx:fillmx:SolidColor color="0xFF"//mx:fill/mx:BarSeries/mx:series/mx:BarChartmx:Legend dataProvider="{barchartDealers}" x="74.5" y="151"width="522" height="31" fontSize="9" id="barchartDealersLegend"/-Any help with this would be greatly appreciated!I hope that my example was clear enough, it should run on it's own ifyou cut/paste it into a blank Flex app. __._,_.___ -- 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 Software development tool Software development Software development services Home design software Software development company YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
RE: [flexcoders] Customizing datatip function for 100% bar chart
return Series(e.item.element).displayName; This didn't work for me, but this did: return BarSeries(e.element).displayName; hth, m -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ely Greenfield Sent: Thursday, August 31, 2006 1:27 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Customizing datatip function for 100% bar chart return Series(e.item.element).displayName; Ely. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of j_sevlie Sent: Thursday, August 31, 2006 9:17 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Customizing datatip function for 100% bar chart Using Flex 2. I have a 100% bar chart that I need help figuring out how to get access to some of the series data for display in a data tip. Here's the scenario: There are 4 regions in the country, each of them gets their own bar in the chart.. - North Region - South Region - West Region - East Region Each bar has 4 individual peices to it, which together sum to 100%: - Used Sales - New Sales - Parts - Accessories What I need is a way to display the name of the grouping (Used Sales, New Sales, etc) inside my datatip. I cannot for the life of me figure out how to do this. Here's the code that I'm working with: - mx:Script ![CDATA[ import mx.charts.HitData; public function dataTipsBarChart(e:HitData):String { /* so far I know how to get the region name, but how do you get the actual displayname of the series that is being rolled over? */ return e.item.region; } ]] /mx:Script mx:BarChart x=10 y=36 width=80% height=124 id=barchartDealers type=100% showDataTips=true dataTipFunction=dataTipsBarChart mx:dataProvider mx:Array mx:Object region=North newsales=50 usedsales=25 parts=15 accessories=10 / mx:Object region=South newsales=40 usedsales=35 parts=10 accessories=15 / mx:Object region=East newsales=65 usedsales=15 parts=10 accessories=10 / mx:Object region=West newsales=60 usedsales=20 parts=15 accessories=5 / /mx:Array /mx:dataProvider mx:verticalAxis mx:CategoryAxis categoryField=region displayName=/ /mx:verticalAxis mx:horizontalAxis mx:LinearAxis minimum=0 maximum=100/ /mx:horizontalAxis mx:series mx:BarSeries displayName=New Sales yField=region xField=newsales mx:fill mx:SolidColor color=0x009900/ /mx:fill /mx:BarSeries mx:BarSeries displayName=Used Sales yField=region xField=usedsales mx:fill mx:SolidColor color=0x00/ /mx:fill /mx:BarSeries mx:BarSeries displayName=Parts yField=region xField=parts mx:fill mx:SolidColor color=0xFF9900/ /mx:fill /mx:BarSeries mx:BarSeries displayName=Accessories yField=region xField=accessories mx:fill mx:SolidColor color=0xFF/ /mx:fill /mx:BarSeries /mx:series /mx:BarChart mx:Legend dataProvider={barchartDealers} x=74.5 y=151 width=522 height=31 fontSize=9 id=barchartDealersLegend/ - Any help with this would be greatly appreciated! I hope that my example was clear enough, it should run on it's own if you cut/paste it into a blank Flex app. -- 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/