5 Replies Latest reply on Jun 1, 2009 4:30 AM by _Natasha_

    how to create boxplotchart in flex3

    bharghava.raparla

      I have been asked to create boxplotChart in Flex3. Can Any one give me a suggestion.If any one tried please paste the code

        • 1. Re: how to create boxplotchart in flex3
          _Natasha_ Level 4

          Hi,

          It's not clear what do you mean under boxplotchart.

           

          Example for PlotChart with Boxes for items. If not, explain what you mean.

           

          // compilced from sdk docs

          <?xml version="1.0"?>
          <!-- Simple example to demonstrate the PlotChart control. -->
          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
              <mx:Script>
                  <![CDATA[
                  import
           mx.collections.ArrayCollection;
          
                  [Bindable]
                  private var expensesAC:ArrayCollection = new ArrayCollection( [
                      { Month: "Jan", Profit: 2000, Expenses: 1500, Amount: 450 },
                      { Month: "Feb", Profit: 1000, Expenses: 200, Amount: 600 },
                      { Month: "Mar", Profit: 1500, Expenses: 500, Amount: 300 } ]);
                  ]]>
              </mx:Script>
          
              <!-- Define custom colors for use as plot point fills. -->
              <mx:SolidColor id="sc1" color="blue" alpha=".3"/>
              <mx:SolidColor id="sc2" color="red" alpha=".3"/>
              <mx:SolidColor id="sc3" color="green" alpha=".3"/>
          
              <!-- Define custom Strokes. -->
              <mx:Stroke id="s1" color="blue" weight="1"/>
              <mx:Stroke id="s2" color="red" weight="1"/>
              <mx:Stroke id="s3" color="green" weight="1"/>
          
              <mx:Panel title="PlotChart Control Example" height="100%" width="100%">
                  <mx:PlotChart id="plot" 
                      height="100%" 
                      width="100%"
                      paddingLeft="5" 
                      paddingRight="5" 
                      showDataTips="true" 
                      dataProvider="{expensesAC}"
                  >                
                      <mx:series>
                          <mx:PlotSeries
                              xField="Expenses"
                              yField="Profit"
                              displayName="Plot 1"
                              fill="{sc1}"
                              stroke="{s1}"
                                                itemRenderer="mx.charts.renderers.BoxItemRenderer"       
                               />
                     </mx:series>
                 </mx:PlotChart>
                  <mx:Legend dataProvider="{plot}"/>
              </mx:Panel>
          </mx:Application>

          • 2. Re: how to create boxplotchart in flex3
            bharghava.raparla Level 1

            hi Natasha,

             

                      http://en.wikipedia.org/wiki/Box_plot

             

            Can you refer this.this is what i want.

             

            Thanks

            • 4. Re: how to create boxplotchart in flex3
              bharghava.raparla Level 1

              HLOC will take only 4 values HIGH LOW OPEN CLOSE values.

              But the boxplot will take 5 values. Max,Min,q1,q2,q3 where HIGH and LOW equal to Max and Min.

              q1 and q3 equal to open and close but the q2  median of the q1 and q3. but it is represented in between the box as a line.

              If you observe clearly u can see that.

              Thanks

              • 5. Re: how to create boxplotchart in flex3
                _Natasha_ Level 4

                There are two ways: extend HLOC or find solution in other components.

                1 person found this helpful