2 Replies Latest reply on Nov 10, 2010 1:34 AM by selvakumar p

    Data Labels in line series

    selvakumar p

      Hi all,


      Is it possible to have data labels for line series as we have for column series.

      If it is  possible somebody help me on this.



        • 1. Re: Data Labels in line series
          BhaskerChari Level 4

          Hi Selvakumar,


          Data Labels are different from data tips. I dont think we can specify data labels for LineSeries. But we can make all the data tips to display by default by setting the showAllDataTips="true" on LineChart which might serve your need.


          Check the link below:






          You can also check this sample code...


          <?xml version="1.0"?>
          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
               import mx.collections.ArrayCollection;

                public var SMITH:ArrayCollection = new ArrayCollection([
                  {date:"22-Aug-05", close:41.87},
                  {date:"23-Aug-05", close:45.74},
                  {date:"24-Aug-05", close:42.77},
                  {date:"25-Aug-05", close:48.06},

                public var DECKER:ArrayCollection = new ArrayCollection([
                  {date:"22-Aug-05", close:157.59},
                  {date:"23-Aug-05", close:160.3},
                  {date:"24-Aug-05", close:150.71},
                  {date:"25-Aug-05", close:156.88},

              public var deckerColor:Number = 0x224488;

              public var smithColor:Number = 0x884422;

            <mx:Stroke id="h1Stroke" color="{smithColor}" weight="8" alpha=".75" caps="square"/>

            <mx:Stroke id="h2Stroke" color="{deckerColor}" weight="8" alpha=".75" caps="square"/>

            <mx:Panel title="Column Chart With Multiple Axes">
               <mx:LineChart id="myChart" showAllDataTips="true" showDataTips="true">
                     <mx:CategoryAxis id="h1" categoryField="date"/>

                      <mx:AxisRenderer placement="bottom" axis="{h1}"/>

                      <mx:AxisRenderer canDropLabels="true" placement="left" axis="{v1}">
                      <mx:AxisRenderer placement="left" axis="{v2}">
                      <mx:AxisRenderer placement="left" axis="{v3}">

                     <mx:LineSeries id="cs1" horizontalAxis="{h1}" dataProvider="{SMITH}" yField="close" displayName="SMITH">
                              <mx:SolidColor color="{smithColor}"/>
                             <mx:LinearAxis id="v1" minimum="40" maximum="50"/>
                     <mx:LineSeries id="cs2" horizontalAxis="{h1}" dataProvider="{DECKER}" yField="close" displayName="DECKER">
                              <mx:LinearAxis id="v2" minimum="150" maximum="170"/>          
                              <mx:Stroke color="{deckerColor}" weight="4" alpha="1"/>
                     <mx:LineSeries id="cs3" horizontalAxis="{h1}" dataProvider="{DECKER}" yField="close" displayName="DECKER">
                              <mx:LinearAxis id="v3" minimum="100" maximum="170"/>          
                              <mx:Stroke color="{deckerColor}" weight="4" alpha="1"/>
               <mx:Legend dataProvider="{myChart}"/>





          • 2. Re: Data Labels in line series
            selvakumar p Level 1

            Hi ,


            Thanks for ur reply

            I have a column chart which is having line series i want to display labels only for line series .

            If iam giving showalldatatips to true then the columnsereis datatip is also shown, i want only the line series datatip to be shown like labels