title: sort a normalized stacked bar chart with Altair
body: <p>I am attempting to sort a normalized stacked bar chart based on a specific order.</p>
  <p>I would like stacked bars sorted by this order:</p>
  <pre><code>Order = dict({'Paid work':1,'Education':2,'Sleep':3,'Other unpaid work':4,'Housework &amp; Shopping':5,'Personal care':6, 'Eating and drinking':7,'TV and Radio':8,'Seeing friends':9,'Other leisures':10})
  </code></pre>
  <p>and Country (Y axis) should be also sorted by the length of &quot;Paid work&quot; bars.</p>
  <p>But I've got is this order with &quot;TV &amp; Radio&quot; on the left end side of the chart and cant see in which country people spend time on &quot;paid work&quot; most.</p>
  <p>My attempt:</p>
  <p><img src="https://i.stack.imgur.com/m6iUR.png" alt="enter image description here" /></p>
  <p>Wrong code:</p>
  <pre><code>alt.Chart(df).mark_bar(size=15).encode(
      alt.Y('Country:O'),
      alt.X('Time:Q', stack='normalize',sort=alt.EncodingSortField(field='Order',order='descending')),
      
      alt.Color('Category:N',sort=alt.EncodingSortField(field='Order')),
      tooltip=['Country', 'Category', 'Time']
  ).properties(
      width=600,
      height=600, title = {'text' :'How do people spend their time?',
  'subtitle' : 'Average of minutes per day from time-use diaries for people between 15 and 64'})
  </code></pre>
  <p>I'm new to this platform, please take a look at the data and my simple code in this notebook: <a href="https://www.kaggle.com/hoangyennhi/exercise-dv" rel="nofollow noreferrer">https://www.kaggle.com/hoangyennhi/exercise-dv</a></p>