title: dynamically fill a json variable
body: <p>I am trying to dynamically fill my chartjs with data from a database. 
  The data is Volume specific (Letter and usage in percent). </p>
  
  <p>Due to the flexibility of the database structure, i decided to put all volume informations in one single cell, which divides each volume with a whitespace and the letter and percentage with a comma.</p>
  
  <p>Now i need to put this data dynamically inside a json variable so i can push it to my chart. At the moment it looks like this:</p>
  
  <pre><code>var jsonData = {
      "L": [{"y": 100}, {"y": 50}, {"y": 40}],
      "C": [{"y": 61}, {"y": 39}, {"y": 59}],
      "": [{"y": 33}, {"y": 97}, {"y": 67}]
  }
  </code></pre>
  
  <p>But those values and volume letters are hardcoded. So i need to split up my php string, which includes the volumes, and somehow pass it for every entry to the json variable. </p>
  
  <p>I need to select each letter <strong>once</strong>, and <strong>every</strong> value which belongs to the correspondending letter.</p>
  
  <p>Also i should mention, that the json variable needs to be dynamically extendable because it is possible that there are more than 3 volumes per cell.</p>