1 Reply Latest reply on Mar 29, 2011 12:38 AM by Lutz@Evonik

    Problem with FTE in DataTips of PlotChart (missing texts)

    Lutz@Evonik

      Hi @all,

       

      we have decided to use the Flex 4.1 and Flash text engine in our projects.

      Now I have the following problem with the dataTips: the texts are appearing only partly if datatips of more than one point are showing. The behavior is not regularly.

      Here is my code for testing (compiler options: hook at "Use Flash Text engine in MX components":

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

        xmlns:s="library://ns.adobe.com/flex/spark"

        xmlns:mx="library://ns.adobe.com/flex/mx"

        minWidth="955"

        minHeight="600"

        creationComplete="init()">

        <fx:Declarations>

          <mx:SolidColor id="sc1" color="#EC6605" alpha=".3"/>

          <mx:SolidColorStroke id="s1" color="#EC6605" weight="1"/>

        </fx:Declarations>

       

        <fx:Script>

          <![CDATA[

            import mx.charts.HitData;

            import mx.collections.ArrayCollection;

       

            [Bindable]

            private var seriesAverageScores:ArrayCollection = new ArrayCollection(new Array());

            private static const tipDataString:String = "zeile 1 zeile 1 zeile 1\nzeile 2 zeile 2 zeile 2\nzeile 3 zeile 3 zeile 3\nzeile 4 zeile 4 zeile 4\n -\n -\n -";

       

            private function init():void {

              seriesAverageScores.addItem({x: 1, y: 2, dataTip: tipDataString});

              seriesAverageScores.addItem({x: 2, y: 2, dataTip: tipDataString});

              seriesAverageScores.addItem({x: 3, y: 2, dataTip: tipDataString});

              seriesAverageScores.addItem({x: 1.1, y: 2, dataTip: tipDataString});

              seriesAverageScores.addItem({x: 2, y: 2, dataTip: tipDataString});

              seriesAverageScores.addItem({x: 3, y: 2, dataTip: tipDataString});

              seriesAverageScores.addItem({x: 1.05, y: 2, dataTip: tipDataString});

              seriesAverageScores.addItem({x: 2, y: 2, dataTip: tipDataString});

              seriesAverageScores.addItem({x: 3, y: 2, dataTip: tipDataString});

              seriesAverageScores.addItem({x: 0.95, y: 2, dataTip: tipDataString});

              seriesAverageScores.addItem({x: 2, y: 2, dataTip: tipDataString});

              seriesAverageScores.addItem({x: 3, y: 2, dataTip: tipDataString});

              seriesAverageScores.addItem({x: 1.2, y: 2, dataTip: tipDataString});

              seriesAverageScores.addItem({x: 2, y: 2, dataTip: tipDataString});

              seriesAverageScores.addItem({x: 3, y: 2, dataTip: tipDataString});

              seriesAverageScores.addItem({x: 1.15, y: 2, dataTip: tipDataString});

              seriesAverageScores.addItem({x: 2, y: 2, dataTip: tipDataString});

              seriesAverageScores.addItem({x: 3, y: 2, dataTip: tipDataString});

              seriesAverageScores.addItem({x: 1.12, y: 2, dataTip: tipDataString});

              seriesAverageScores.addItem({x: 2, y: 2, dataTip: tipDataString});

            }

       

            private function dataTipFunction_average(hd:HitData):String {

              var val:String;

              var d:Object = hd.item as Object;

              return d.dataTip;

            }

          ]]>

        </fx:Script>

        <s:VGroup width="100%"

          height="100%">

          <mx:PlotChart id="myChart1" width="100%" height="100%"

            dataTipFunction="dataTipFunction_average" showDataTips="true">

       

            <mx:verticalAxis>

              <mx:LinearAxis title="TurnOvers" padding="0.1" minimum="0" maximum="50"/>

            </mx:verticalAxis>

            <mx:horizontalAxis>

            <mx:LinearAxis title="Scores" padding="0.1" minimum="0" maximum="10"/>

            </mx:horizontalAxis>

            <mx:series>

              <mx:PlotSeries dataProvider="{seriesAverageScores}"

                name="series 1" fill="{sc1}" stroke="{s1}"

                displayName="Average Scores per customer"

                xField="x"

                yField="y">

              </mx:PlotSeries>

            </mx:series>

          </mx:PlotChart>

        </s:VGroup>

       

      </s:Application>

      Has anyone an idea how to solve this ?
      Thanks, Lutz