3 Replies Latest reply on Aug 18, 2009 11:53 PM by KalavatiSingh

    dataTipFunction in Multi series

    KalavatiSingh Level 1

      Hi,

          As per my requirement i have Line Chart that has multiple series(Column &  Line ) I want the dataTipfuction function  that shows details as per mouseover on each graph.Any example or document please forward

       

       

       

       

      Regards

      Kalavati Singh

      kalavati_singh@yahoo.co.in

        • 1. Re: dataTipFunction in Multi series
          kkc_mca Level 2

          for the CategoryAxis speficy the property labelFunction

           

          where in the function generate a string which display on the label.

           

          Here I placed the example

           

          if this post answers your question or help. please mark it as such

           

          ==================================================

                                                code

          ==============================================

           

           

          <?xml version="1.0"?>

          <!-- http://blog.flexexamples.com/2007/11/16/creating-a-custom-label-function-on-a-flex-linecha rt-controls-category-axis/ -->

          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"

                  layout="vertical"

                  verticalAlign="middle"

                  backgroundColor="white">

           

              <mx:Script>

                  <![CDATA[

                      private function categoryAxis_labelFunc(item:Object, prevValue:Object, axis:CategoryAxis, categoryItem:Object):String {

                          var datNum:Number = Date.parse(item);

                          var tempDate:Date = new Date(datNum);

                          return dateFormatter.format(tempDate).toUpperCase();

                      }

                  ]]>

              </mx:Script>

           

              <mx:DateFormatter id="dateFormatter" formatString="MMMM-DD-YYYY" />

           

              <mx:XMLListCollection id="dp">

                  <mx:source>

                      <mx:XMLList>

                          <quote date="8/1/2007" open="40.29" />

                          <quote date="8/2/2007" open="39.4" />

                          <quote date="8/3/2007" open="39.47"  />

                          <quote date="8/6/2007" open="38.71" />

                          <quote date="8/7/2007" open="39.08"  />

                          <quote date="8/8/2007" open="39.61"  />

                          <quote date="8/9/2007" open="39.9" />

                          <quote date="8/10/2007" open="41.3"  />

                          <quote date="8/13/2007" open="41" />

                          <quote date="8/14/2007" open="41.01"  />

                          <quote date="8/15/2007" open="40.22" />

                          <quote date="8/16/2007" open="39.83" />

                          <quote date="8/17/2007" open="40.18" />

                          <quote date="8/20/2007" open="40.55" />

                          <quote date="8/21/2007" open="40.41" />

                          <quote date="8/22/2007" open="40.4" />

                          <quote date="8/23/2007" open="40.82" />

                          <quote date="8/24/2007" open="40.5" />

                          <quote date="8/27/2007" open="40.38" />

                      </mx:XMLList>

                  </mx:source>

              </mx:XMLListCollection>

           

              <mx:XMLListCollection id="dp2">

                  <mx:source>

                      <mx:XMLList>

                          <quote date="8/1/2007" close="50.58" />

                          <quote date="8/2/2007"  close="39.52" />

                          <quote date="8/3/2007" close="39.75" />

                          <quote date="8/6/2007"  close="39.38" />

                          <quote date="8/7/2007" close="50.42" />

                          <quote date="8/8/2007"  close="40.23" />

                          <quote date="8/9/2007" close="40.75" />

                          <quote date="8/10/2007" close="41.06" />

                          <quote date="8/13/2007" close="40.83" />

                          <quote date="8/14/2007" close="40.41" />

                          <quote date="8/15/2007" close="40.18" />

                          <quote date="8/16/2007" close="39.96" />

                          <quote date="8/17/2007" close="40.32" />

                          <quote date="8/20/2007" close="40.74" />

                          <quote date="8/21/2007" close="40.13" />

                          <quote date="8/22/2007" close="40.77" />

                          <quote date="8/23/2007" close="40.6" />

                          <quote date="8/24/2007" close="40.41" />

                          <quote date="8/27/2007" close="40.81" />

                      </mx:XMLList>

                  </mx:source>

              </mx:XMLListCollection>

           

              <mx:XMLListCollection id="dp3">

                  <mx:source>

                      <mx:XMLList>

                          <quote date="8/1/2007" avg="45.58" />

                          <quote date="8/2/2007"  avg="39.52" />

                          <quote date="8/3/2007" avg="39.75" />

                          <quote date="8/6/2007"  avg="39.38" />

                          <quote date="8/7/2007" avg="35.42" />

                          <quote date="8/8/2007"  avg="40.23" />

                          <quote date="8/9/2007" avg="40.75" />

                          <quote date="8/10/2007" avg="41.06" />

                          <quote date="8/13/2007" avg="40.83" />

                          <quote date="8/14/2007" avg="40.41" />

                          <quote date="8/15/2007" avg="40.18" />

                          <quote date="8/16/2007" avg="39.96" />

                          <quote date="8/17/2007" avg="42.32" />

                          <quote date="8/20/2007" avg="40.74" />

                          <quote date="8/21/2007" avg="38.13" />

                          <quote date="8/22/2007" avg="40.77" />

                          <quote date="8/23/2007" avg="40.6" />

                          <quote date="8/24/2007" avg="40.41" />

                          <quote date="8/27/2007" avg="40.81" />

                      </mx:XMLList>

                  </mx:source>

              </mx:XMLListCollection>

           

           

              <mx:LineChart id="lineChart"

                      showDataTips="true"

                      dataProvider="{dp}"

                      width="100%"

                      height="100%">

           

                  <!-- vertical axis -->

                  <mx:verticalAxis>

                      <mx:LinearAxis baseAtZero="false"

                              title="Price" />

                  </mx:verticalAxis>

           

                  <!-- horizontal axis -->

                  <mx:horizontalAxis>

                      <mx:CategoryAxis id="ca"

                              categoryField="@date"

                              title="Date"

                              labelFunction="categoryAxis_labelFunc" />

                  </mx:horizontalAxis>

           

                  <!-- horizontal axis renderer -->

                  <mx:horizontalAxisRenderers>

                      <mx:AxisRenderer axis="{ca}"

                              canDropLabels="true" />

                  </mx:horizontalAxisRenderers>

           

                  <!-- series -->

                  <mx:series>

                      <mx:LineSeries yField="@open"

                              form="curve"

                              displayName="Open" />

           

                      <mx:LineSeries dataProvider="{dp2}" yField="@close"

                              form="curve"

                              displayName="Close" />

                      <mx:LineSeries dataProvider="{dp3}" yField="@avg"

                              form="curve"

                              displayName="Avg">

                      <mx:lineStroke>

                                  <mx:Stroke color="0x00ff00" weight="2" alpha="3" />

                          </mx:lineStroke>

                      </mx:LineSeries>

           

                  </mx:series>

           

                  <!-- series filters -->

                  <mx:seriesFilters>

                      <mx:Array />

                  </mx:seriesFilters>

              </mx:LineChart>

           

          </mx:Application>

           

           

          if this post answers your question or help. please mark it as such

          • 2. Re: dataTipFunction in Multi series
            KalavatiSingh Level 1

            Hi,

                There is no attachement.please send it again.

             

             

            Regards

            kalavati

            • 3. Re: dataTipFunction in Multi series
              kkc_mca Level 2

              I updated the above message as i am getting error when i upload a attachment

               

              if this post answers your question or helps. please mark it as such