title: Vega-Lite : Stacked Grouped Bar Chart
body: <p>I'm using Vega-Lite for Data Studio and I'm trying to create a Stacked AND Grouped bar chart.<br>
  For the moment, I have this result : <a href="https://i.stack.imgur.com/HO1wR.png" rel="nofollow noreferrer">https://i.stack.imgur.com/HO1wR.png</a></p>
  <p>However, what I want to do is to have LEFT bars with GREEN gradient &amp; RIGHT bars with BLUE gradient. <br>
  So my question is : How can I perform this kind of chart ? <br>
  e.g : <a href="https://i.stack.imgur.com/J5223.png" rel="nofollow noreferrer">https://i.stack.imgur.com/J5223.png</a></p>
  <p>Here, you'll find what I've done :</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;$schema&quot;: &quot;https://vega.github.io/schema/vega-lite/v5.json&quot;,
    &quot;data&quot;: {
      &quot;values&quot;  : [
        {&quot;Team&quot; : &quot;X&quot;, &quot;Task&quot; : &quot;A&quot;, &quot;Done&quot; : 56.5, &quot;Planned&quot; : 80, &quot;Activity_Type&quot; : &quot;TypeA&quot;},
        {&quot;Team&quot; : &quot;X&quot;, &quot;Task&quot; : &quot;A&quot;, &quot;Done&quot; : 26, &quot;Planned&quot; : 14, &quot;Activity_Type&quot; : &quot;TypeB&quot;},
        {&quot;Team&quot; : &quot;X&quot;, &quot;Task&quot; : &quot;B&quot;, &quot;Done&quot; : 26, &quot;Planned&quot; : 21, &quot;Activity_Type&quot; : &quot;TypeA&quot;},
        {&quot;Team&quot; : &quot;X&quot;, &quot;Task&quot; : &quot;B&quot;, &quot;Done&quot; : 16.5, &quot;Planned&quot; : 36, &quot;Activity_Type&quot; : &quot;TypeB&quot;},
        {&quot;Team&quot; : &quot;X&quot;, &quot;Task&quot; : &quot;C&quot;, &quot;Done&quot; : 41.5, &quot;Planned&quot; : 59, &quot;Activity_Type&quot; : &quot;TypeA&quot;},
        {&quot;Team&quot; : &quot;X&quot;, &quot;Task&quot; : &quot;C&quot;, &quot;Done&quot; : 9, &quot;Planned&quot; : 12, &quot;Activity_Type&quot; : &quot;TypeB&quot;}
      ] 
    },
    &quot;height&quot; : 200,
    &quot;width&quot; : 500,
    &quot;encoding&quot;: {
      &quot;tooltip&quot; : [
        {&quot;field&quot; : &quot;Team&quot;},
        {&quot;field&quot; : &quot;Task&quot;},
        {&quot;field&quot; : &quot;Done&quot;},
        {&quot;field&quot; : &quot;Planned&quot;},
        {&quot;field&quot; : &quot;Activity_Type&quot;}
      ],
      &quot;y&quot;: {&quot;axis&quot;: {&quot;title&quot;: &quot;Number of points&quot;}},
      &quot;x&quot;: {&quot;field&quot;: &quot;Task&quot;, &quot;type&quot;: &quot;nominal&quot;, &quot;axis&quot;: {&quot;labelAngle&quot;: 0}}
    },
    &quot;layer&quot;: [
      {
        &quot;mark&quot;: {&quot;type&quot;: &quot;bar&quot;, &quot;xOffset&quot;: -16, &quot;size&quot;: 30, &quot;color&quot;: &quot;#81c784&quot;},
        &quot;encoding&quot;: {
          &quot;y&quot;: {
            &quot;field&quot;: &quot;Done&quot;,
            &quot;type&quot;: &quot;quantitative&quot;
          },
          &quot;color&quot;: {
            &quot;field&quot;: &quot;Activity_Type&quot;,
            &quot;type&quot;: &quot;nominal&quot;,
            &quot;scale&quot;: {
              &quot;range&quot;: [&quot;#81c784&quot;, &quot;#629b65&quot;, &quot;#3d683f&quot;] // GREEN GRADIENT
            },
            &quot;title&quot;: &quot;Activity_Type&quot;,
            &quot;legend&quot; : null
          }
        }
      },
      {
        &quot;mark&quot;: {
          &quot;type&quot;: &quot;bar&quot;, &quot;size&quot;: 30, &quot;xOffset&quot;: 16, &quot;color&quot; : &quot;#1e88e5&quot;
        },
        &quot;encoding&quot;: {
          &quot;y&quot;: {
            &quot;field&quot;: &quot;Planned&quot;,
            &quot;type&quot;: &quot;quantitative&quot;
          },
          &quot;color&quot;: {
            &quot;field&quot;: &quot;Activity_Type&quot;,
            &quot;type&quot;: &quot;nominal&quot;,
            &quot;scale&quot;: {
              &quot;range&quot;: [&quot;#1e88e5&quot;, &quot;#2f75b3&quot;, &quot;#255279&quot;] // BLUE GRADIENT
            },
            &quot;legend&quot; : null
          }
        }
      }
    ]
  }
  </code></pre>
  <p>Thanks by advance for your help !</p>