1 Reply Latest reply: Jul 31, 2013 10:52 PM by Ajay Prabhakar Barokar RSS

    How to combine line chart and stacked column chart?

    Lior Bruder Community Member

      Hi All,

       

      I need to create a chart that will look like this:

       

      pic1.png

       

      This chart is composed of stacked chart and line chart.  I found how to combine regular column charts and line graphs but did not find how to combine stacked comlumn charts with line graphs.

       

      Can anyone help me or refere me to somewhere?

       

      Thanks in advance,

      Lior

        • 1. Re: How to combine line chart and stacked column chart?
          Ajay Prabhakar Barokar Community Member

          Hi lior,

          You can use catesian chart as base chart .

          try this sample

           

          <mx:CartesianChart id="myChart" dataProvider="{expenses}" showDataTips="true">

                  <mx:horizontalAxis>

                     <mx:CategoryAxis

                          dataProvider="{expenses}"

                          categoryField="Month"

                     />

                  </mx:horizontalAxis>

                 <mx:series>

                      <mx:ColumnSet type="stacked" allowNegativeForStacked="true">

                          <mx:series>

                              <mx:ColumnSeries

                                  xField="Month"

                                  yField="Profit"

                                  displayName="Profit"

                              />

                              <mx:ColumnSeries

                                  xField="Month"

                                  yField="Expenses"

                                  displayName="Expenses"

                              />

                          </mx:series>

                      </mx:ColumnSet>   

                      <mx:LineSeries xField="Month"

                                  yField="Expenses"

                                  displayName="Expenses"/> 

                      <mx:LineSeries

                      xField="Month"

                      yField="Profit"

                      displayName="Profit"

                  />  

                  </mx:series>

                 

               </mx:CartesianChart>

              

            </mx:Panel>

          Output:

          Capture.JPG