Set dataTipRenderer on a series-basis for Flex charts?

815 views Asked by At

I have a Flex LineChart which contains three series:

  • two LineSeries
  • one ColumnSet

Has anyone seen or heard of a way to set the dataTipRenderer on a per-series basis? You can only override it for the entire chart and I would prefer to not have to overlay multiple charts just to achieve this effect.

1

There are 1 answers

0
David On

do you found a answer for your problem? i want to pick up the question of david goshadze and suggest you to look what i did:

there is a way to get the series by the data object. you have to choose for the dataTipRenderer a component (e.g. canvas but its mx) which implements the IFlexDisplayObject and IDataRenderer and then override the data getter and setter or you implement in your own DataTipRenderer class the interfaces (optional: extends e.g. VGroup) and implement the data getter and setter. now you could cast the value parameter in the data setter to HitData and then check which class the element object is:

public override function set data(value:Object):void
{
    var hitData:HitData = value as HitData;
    if(hitData.element is LineSeries)
        // do lineseries stuff
    else if(hitData.element is ColumnSeries)
        // do columnseries stuff
}

now you know which series take the renderer and you can render individual datatips.

hope this helps!