2 Replies Latest reply on Apr 26, 2011 7:42 AM by DrBarash

    flex 3.5 lineChart and toolTips

    DrBarash

      Hello,

       

      I created a lineChart containing four different serieses, set the showDataTips to true and created a nice dataTipFunction.

      The problem is, that I want only two serieses to have toolTips, and not all four.

       

      I just can't do this.... and it's driving me crazy.

       

      I tryed to return null from the dataTipFunction - but still, the toolTip was shown empty.

      I tryed to use ToolTipManager - doesn't work

      I tryed seeting  the chart's showDataTips inside  the dataTipFunction the to flase/true according to the situation, it made a mess when the graphs met together.

      I tryed events like 'toolTipCreate' and etc - doesn't work.

      I tryed setting the charts showDataTips to false and create the toolTips on my own with ToolTipManager - it looked bad, there was no little point on the graph.

       

      If only hitData had something like stopImidatePropegation...

       

      Any more ideas guys?

       

       

      Thank you all

      DrBarash

       

      Message was edited by: DrBarash

        • 1. Re: flex 3.5 lineChart and toolTips
          flex4 Level 2

          Hi

           

          Please post you dataTipFunction code. that would help us to find the problem..

          • 2. Re: flex 3.5 lineChart and toolTips
            DrBarash Level 1

            OK, here it is.

             

            I set to bold the place where i decide if this series should have a toolTip.

             

            Everything else works just fine.

             

            Thank you

             

             

             

            
            private function dataTipFunction(event:HitData):String
            {
            var result:String = "";
            var item:LineSeriesItem = event.chartItem as LineSeriesItem;
            var seriesDisplayName:String = (item.element as LineSeries).displayName;
            var xValue:Date = item.xValue as Date;
            var yValue:Number = item.yValue as Number;
            var monthNumber:Number = DateUtils.dateDiff(DateUtils.MONTH, Consts.START_DATE, xValue) + 1;
            var profit:Number;
            var seriesName:String;
            
            // const series - dont show toolTip
            if(seriesDisplayName == callPriceSeries.displayName || seriesDisplayName == strikePriceSeries.displayName)
            {
            return null;
            }
            
            
            if(seriesDisplayName == underlyingSeries.displayName)
            {
            profit = controller.getProfitOnDate(xValue, model.underlyingSeries);
            seriesName = ResourceUtils.getString('resultsRow2Header');
            }
            else
            {
            profit = controller.getProfitOnDate(xValue, model.cbbcSeries);
            seriesName = ResourceUtils.getString('resultsRow3Header');
            }
            
            result += '<b><font size="13">' + ResourceUtils.getString('month') + ' #' + monthNumber + ': </font></b><br>';
            result += '<font size="13" >' + seriesName + ' ' + ResourceUtils.getString('price') + ': ' + numberFormatter.format(yValue) + ' ' + ResourceUtils.getString('currency') + ' </font>';
            result += '<br>'
            result += '<font size="13" >' + ResourceUtils.getString('currentPL') + ': ' + numberFormatter.format(profit) + ResourceUtils.getString('currency') + ' </font>';
            
            return result;
            }