git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hitData function. How to Determine the LineSeries I have hit


Thank you very much.
With a Slight modification it gives me the LineSeries name:-)
var elementName:String = String(hitData.element);
var c:int = elementName.lastIndexOf(".");
var lineSeriesName:String = elementName.substring(c + 1);

Please consider this question answered, with many thanks!

> On 13 Jul 2018, at 07:43, Alex Harui <aharui@xxxxxxxxx.INVALID> wrote:
> 
> Are you looking for something like:
> 
> var elementName:String = hitData.element.toString();
> var c:int = elementName.lastIndexOf(".");
> var lineSeriesName:String = elementName.substring(c + 1);
> 
> Of course, I could be wrong...
> 
> HTH,
> -Alex
> 
> On 7/12/18, 4:33 AM, "npem" <philip.medlam@xxxxxxxxx <mailto:philip.medlam@xxxxxxxxx>> wrote:
> 
>    Hi,
>        I have a LineChart:
>    *<mx:LineChart id="myChartLive"  dataTipFunction="LineChartDataTips">*
> 
>     with several LineSeries:
>    * 
>    <mx:LineSeries id="LineSeries1" xField="x" yField="yTOP" form="curve"
>    displayName="CF1" lineStroke="{s1}"/>
>    <mx:LineSeries id="LineSeries2" xField="x" yField="yBOT" form="curve"
>    displayName="CF2" lineStroke="{s1}"/>
>    ...     ...
>    ...     ...
>    *
> 
>    Anyone any idea how I can tell (within the LineChartDataTips function, which
>    LineSeries I have
>    Hit on the chart?
> 
>    One example from tracing:
>    *hitData.element
>    *
> 
>    Is:
>    *Algebra_GCSE2.ViewNavigatorApplicationSkin4.navigator.ViewNavigatorSkin6.contentGroup.principalStresses17.SkinnableContainerSkin18.contentGroup.myScroller1.ScrollerSkin73.myVgroup1.myPanel1.PanelSkin119._PanelSkin_Group1.contents.contentGroup.myChartLive.UIComponent129.UIComponent130.LineSeries5*
> 
>    But I do not know how to convert this to a string, to search for LineSeries5
>    (In this case)
> 
>    Help would be greatly appreciated,
>    Phil.
> 
> 
> 
> 
>    --
>    Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-flex-users.2333346.n4.nabble.com%2F&amp;data=02%7C01%7Caharui%40adobe.com%7C6e9b85b34fe04d01e42808d5e7eb5394%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C636669920256572384&amp;sdata=220doB5901qMOFaASTBPYrSkYMvxcYC8Jdz5vnKKyLs%3D&amp;reserved=0 <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-flex-users.2333346.n4.nabble.com%2F&amp;data=02%7C01%7Caharui%40adobe.com%7C6e9b85b34fe04d01e42808d5e7eb5394%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C636669920256572384&amp;sdata=220doB5901qMOFaASTBPYrSkYMvxcYC8Jdz5vnKKyLs%3D&amp;reserved=0>