title: Stacked bar plot in Pandas with max values instead of being summed
body: <p>I'm trying to replicate work done in an excel pivot table. I have 3 variables (idle time, and total time, and customer). I want to make a bar plot that is stacked(overlaps) but is not a sum of all variables.</p>
  <p>For example: if..</p>
  <pre><code>Total_time = 10
  Idle_time = 3
  </code></pre>
  <p>I want the bar graph to show the max value of idle time and total time for each customer.</p>
  <p>So far when I try to use stacked=True, it just stacks Total &amp; Idle time and creates a bar graph with a max value of 10+3=13. I want two separate bars overlapping each other where one bar maxes at 10 and the other at 3.</p>
  <pre><code>data = df.pivot_table(df,index=['Customer'], aggfunc=np.sum)
  ax = data[['Total time [hours]', 'Idle time [hours]']].plot.bar(stacked=True)
  ax.set_ylabel(&quot;Miles&quot;)
  ax.set_title(&quot;Total Miles Per Customer&quot;)
  
  plt.show()
  </code></pre>
  <p>I've uploaded a screenshot of the excel version, and pandas version for further illustration.</p>
  <h3>Excel Image</h3>
  <p><img src="https://i.stack.imgur.com/FDJWC.jpg" alt="Excel Image" /></p>
  <h3>Pandas Image</h3>
  <p><img src="https://i.stack.imgur.com/PsvDn.jpg" alt="Pandas Image" /></p>
  <p>Thanks in advance.</p>
  <hr />
  <p><strong>UPDATE</strong>: Ted with the solution below.</p>