That's a compile time error, right?
 
You probably need to explicitly cast it to the type you know it to be (i.e., BarSeriesItem, ColumnSeriesItem, etc).
 
Ely.


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of suri_boston
Sent: Monday, October 09, 2006 12:28 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Customizing datatip function for 100% bar chart

i am getting the below error when i try to use the below
e.chartItem.xValue...
any help?
thanks
suri

1119: Access of possibly undefined property xValue through a
reference with static type mx.charts:ChartItem.

--- In [EMAIL PROTECTED]ups.com, "Ely Greenfield" <[EMAIL PROTECTED].>
wrote:
>
>
>
> e.chartItem.xValue (if it's a barSeries, or yValue if it's a
column/area
> series, etc) should do it.
>
> I know, not obvious. Matt's right, a wiki would be helpful.
>
> Ely.
>
>
>
>
> ________________________________
>
> From: [EMAIL PROTECTED]ups.com
[mailto:[EMAIL PROTECTED]ups.com] On
> Behalf Of j_sevlie
> Sent: Friday, September 01, 2006 5:33 AM
> To: [EMAIL PROTECTED]ups.com
> Subject: [flexcoders] Re: Customizing datatip function for 100% bar
> chart
>
>
>
> Oh, and another thing -- my next logical question is:
>
> How do you access the PERCENTAGE that Flex calculates for you
> automatically in a 100% bar chart? Normally with the default
> renderer, Flex will show both the series name, the value of that
block
> in the bar, and what percentage that block is of the total bar.
>
> However, when I'm making my custom datatips, I want to have access
to
> that generated percentage. Anybody know how to get it?
>
> Thanks!
> Jacob
>
> --- In [EMAIL PROTECTED]ups.com <mailto:flexcoders%
40yahoogroups.com>
> , "Matt Horn" <mhorn@> wrote:
> >
> > > 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: [EMAIL PROTECTED]ups.com
> <mailto:flexcoders%40yahoogroups.com>
> > > [mailto:[EMAIL PROTECTED]ups.com
> <mailto:flexcoders%40yahoogroups.com> ] On Behalf Of Ely Greenfield
> > > Sent: Thursday, August 31, 2006 1:27 PM
> > > To: [EMAIL PROTECTED]ups.com <mailto:flexcoders%
40yahoogroups.com>
>
> > > Subject: RE: [flexcoders] Customizing datatip function for
> > > 100% bar chart
> > >
> > >
> > >
> > >
> > > return Series(e.item.element).displayName;
> > >
> > > Ely.
> > >
> > >
> > >
> > > ________________________________
> > >
> > > From: [EMAIL PROTECTED]ups.com
> <mailto:flexcoders%40yahoogroups.com>
> > > [mailto:[EMAIL PROTECTED]ups.com
> <mailto:flexcoders%40yahoogroups.com> ] On Behalf Of j_sevlie
> > > Sent: Thursday, August 31, 2006 9:17 AM
> > > To: [EMAIL PROTECTED]ups.com <mailto:flexcoders%
40yahoogroups.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="0xFFFF00"/>
> > > </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="0xFF0000"/>
> > > </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





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to