title: Write excel file from pandas with bar chart formatting within column created using pandas styles
body: <p>I have data as:</p>
  
  <pre class="lang-py prettyprint-override"><code>s = '{"Date":{"0":"2016-10-03 00:00:00","1":"2016-10-03 00:00:00","2":"2016-10-03 00:00:00","3":"2016-10-04 00:00:00","4":"2016-10-04 00:00:00","5":"2016-10-04 00:00:00","6":"2016-10-05 00:00:00","7":"2016-10-05 00:00:00","8":"2016-10-05 00:00:00"},"Close":{"0":31.5,"1":112.52,"2":57.42,"3":113.0,"4":57.24,"5":31.35,"6":57.64,"7":31.59,"8":113.05},"Volume":{"0":14070500,"1":21701800,"2":19189500,"3":29736800,"4":20085900,"5":18460400,"6":16726400,"7":11808600,"8":21453100},"Symbol":{"0":"CSCO","1":"AAPL","2":"MSFT","3":"AAPL","4":"MSFT","5":"CSCO","6":"MSFT","7":"CSCO","8":"AAPL"}}'
  df = pd.read_json(s)
  </code></pre>
  
  <p>Which looks like: </p>
  
  <pre><code>        Date  Close    Volume Symbol
  0 2016-10-03  31.50  14070500   CSCO
  1 2016-10-03 112.52  21701800   AAPL
  2 2016-10-03  57.42  19189500   MSFT
  3 2016-10-04 113.00  29736800   AAPL
  4 2016-10-04  57.24  20085900   MSFT
  5 2016-10-04  31.35  18460400   CSCO
  6 2016-10-05  57.64  16726400   MSFT
  7 2016-10-05  31.59  11808600   CSCO
  8 2016-10-05 113.05  21453100   AAPL
  </code></pre>
  
  <p>I can create the styling required with the following:</p>
  
  <pre class="lang-py prettyprint-override"><code>format_dict = dict(Date="{:%m/%d/%y}", Close="${:.2f}", Volume="{:,}")
  (
      df.style.format(format_dict)
      .hide_index()
      .bar("Volume", color="lightblue", align="zero")
  )
  </code></pre>
  
  <p>Which looks as:</p>
  
  <p><a href="https://i.stack.imgur.com/3E310.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3E310.png" alt="enter image description here"></a></p>
  
  <p>But when I write to an excel file using:</p>
  
  <pre class="lang-py prettyprint-override"><code>format_dict = dict(Date="{:%m/%d/%y}", Close="${:.2f}", Volume="{:,}")
  df_formatted = (
      df.style.format(format_dict)
      .hide_index()
      .bar("Volume", color="lightblue", align="zero")
  )
  df_formatted.to_excel("demo.xlsx")
  </code></pre>
  
  <p>It gives me the following:</p>
  
  <p><a href="https://i.stack.imgur.com/2eOMD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2eOMD.png" alt="enter image description here"></a></p>
  
  <p>I'm not sure how to fix this. </p>
  
  <p>Here are the packages that I have installed for the virtualenv creating this example:</p>
  
  <pre><code>-&gt; % pip freeze
  et-xmlfile==1.0.1
  jdcal==1.4.1
  Jinja2==2.11.1
  MarkupSafe==1.1.1
  numpy==1.18.2
  openpyxl==3.0.3
  pandas==1.0.3
  python-dateutil==2.8.1
  pytz==2019.3
  six==1.14.0
  </code></pre>