dataTipFunction is a property of the chart, not the series, so you
will have to have a single function that looks at the hitData to
determine which series the mouse is over.  The hitData.element
property will give you access to the properties of the series that the
mouse is over.  If you give the series ids, you can then have your
datatip function call your series specific function based on the
element id.

--- In [email protected], Guido <[EMAIL PROTECTED]> wrote:
>
> any clues on this one guys?
> 
> On Dec 13, 2007 3:20 PM, Guido <[EMAIL PROTECTED]> wrote:
> 
> > Oh, I forgot: I'm using Flex 2.0.1
> >
> >
> > On Dec 13, 2007 3:20 PM, Guido <[EMAIL PROTECTED]> wrote:
> >
> > > Hi, people.
> > >
> > > I have a LineChart with multiple series in it, and I'd like to
have a
> > > custom data tip function for each series, and not one for the
whole chart.
> > > I've thought of a couple of ways of doing this, but none of them
are what
> > > you'd call 'tidy'. I'd like to know if there's a reasonably
declarative
> > > fashion (that is, without using an if ... then ... else
statement and
> > > comparing to a given property on the hit data on my data tip
function) of
> > > specifying a custom data tip function for a specific series in
the chart,
> > > instead of using one single data tip function for all series in
the chart.
> > >
> > > Any ideas on this one?
> > >
> > > Here's my code (I know there's no dataTipFunction specified on
the chart
> > > right now, since it makes data tips for all series the same):
> > >
> > > <mx:LineChart id="lineChart"
> > >     height="100%"
> > >     showDataTips="true"
> > >     width="100%">
> > >
> > >     <mx:horizontalAxis>
> > >      <mx:CategoryAxis
> > >       displayName="Muestra"
> > >       categoryField="{ClinicalStudy.xField}"
> > >       dataProvider="{selectedStudy.results}"/>
> > >     </mx:horizontalAxis>
> > >
> > >     <mx:verticalAxis>
> > >      <mx:LinearAxis
> > >       alignLabelsToInterval="false"
> > >       autoAdjust="false"
> > >       baseAtZero="false"
> > >       displayName="Valor"
> > >       maximum="{maxVerticalAxis}"
> > >       minimum="{minVerticalAxis}"/>
> > >     </mx:verticalAxis>
> > >
> > >     <mx:series>
> > >
> > >      <mx:LineSeries
> > >       dataProvider="{selectedStudy.results}"
> > >       displayName="{ selectedStudy.name}"
> > >       yField="{ClinicalStudy.yField}">
> > >       <mx:lineStroke>
> > >        <mx:Stroke alpha="0.8" color="#F5821F" weight="4"/>
> > >       </mx:lineStroke>
> > >      </mx:LineSeries>
> > >
> > >      <mx:LineSeries
> > >       dataProvider="{selectedStudy.averageDataProvider}"
> > >       displayName="Media"
> > >       yField="{ClinicalStudy.yField}">
> > >       <mx:lineStroke>
> > >        <mx:Stroke alpha="0.8" color="#499615" weight="2"/>
> > >       </mx:lineStroke>
> > >      </mx:LineSeries>
> > >
> > >     </mx:series>
> > > </mx:LineChart>
> > >
> > >
> > > Thanks in advance,
> > >
> > >
> > > Guido.
> > >
> >
> >
>


Reply via email to