title: Convert and map data to chart understandable format
body: <p>I want to convert this data</p>
  <pre><code>var data = [{
      &quot;Country&quot;: &quot;World&quot;,
      &quot;Source&quot;: &quot;Electricity&quot;,
      &quot;Year&quot;: &quot;2022&quot;,
      &quot;Value&quot;: &quot;20.0000&quot;
    },
    {
      &quot;Country&quot;: &quot;World&quot;,
      &quot;Source&quot;: &quot;Gas&quot;,
      &quot;Year&quot;: &quot;2022&quot;,
      &quot;Value&quot;: &quot;30.0000&quot;
    },
    {
      &quot;Country&quot;: &quot;World&quot;,
      &quot;Source&quot;: &quot;Hydrogen&quot;,
      &quot;Year&quot;: &quot;2022&quot;,
      &quot;Value&quot;: &quot;40.0000&quot;
    },
    {
      &quot;Country&quot;: &quot;World&quot;,
      &quot;Source&quot;: &quot;Oil&quot;,
      &quot;Year&quot;: &quot;2022&quot;,
      &quot;Value&quot;: &quot;50.0000&quot;
    },
    {
      &quot;Country&quot;: &quot;World&quot;,
      &quot;Source&quot;: &quot;Renewables&quot;,
      &quot;Year&quot;: &quot;2022&quot;,
      &quot;Value&quot;: &quot;60.0000&quot;
    },{
      &quot;Country&quot;: &quot;World&quot;,
      &quot;Source&quot;: &quot;Renewables&quot;,
      &quot;Year&quot;: &quot;2021&quot;,
      &quot;Value&quot;: &quot;50.0000&quot;
    }
  ];
  </code></pre>
  <p>to this format</p>
  <pre><code>[{
    name: 'Renewables',
    data: [60.0000, 50.0000]
  }, {
    name: 'Oil',
    data: [50.0000]
  },{
    name: 'Hydrogen',
    data: [40.0000]
  }, {
    name: 'Gas',
    data: [30.0000]
  }, {
    name: 'Electricity',
    data: [20.0000]
  }]
  </code></pre>
  <p>how can I do that?</p>
  <p>Any Suggestion please</p>
  <p>Code I have done</p>
  <pre><code> for (let index = 0; index &lt; uniqueSources.length; index++) {
        var arrSmall = [];
        for (let j = 0; j &lt; this.ResponseToShow.length; j++) {
          if (uniqueSources[index] == this.ResponseToShow[j]['Source']) {
            arrSmall.push(Number(this.ResponseToShow[j]['Value']));
          }
        }
      }
      console.log(arrSmall);
  </code></pre>