title: Using Pandas to Make a Stacked Bar Plot Based On Sum of Values
body: <p>I've got a dataframe that looks like this:</p>
  
  <pre><code> Company      Product     Sale Amount   Transaction
  1 Com1        Prod1       $100            T1
  2 Com2        Prod1       $30             T2
  3 Com1        Prod2       $120            T3
  4 Com3        Prod1       $90             T4
  </code></pre>
  
  <p>I want to sum the sale amounts for each company and the put that into a bar graph with the companies on the x axis and Sales Amount on the y axis. But, I want the bar to be a stacked bar where each individual stack is a product that was sold. I'd like this sorted so the highest sum of sales will show up first and descend.</p>
  
  <p>So basically, I'd be able to see a stack of products sold to a company in bar form. </p>
  
  <p>Currently I'm able to print out the summed sales totals of each company like this:</p>
  
  <pre><code>salesTotal=pandaFrame.groupby(['Company Name'])['Sales Amount'].sum().reset_index()
  salesTotal.sort_index(inplace=True)
  salesTotal = salesTotal.sort_values(by=['Sales Amount'], ascending=False)
  </code></pre>
  
  <p>But this gives me a separate dataframe and loses the product info.</p>