title: jQuery multidimensional object with multidimensional arrays
body: <p>Im trying to build a somewhat advanced &quot;Flot&quot; jQuery pluging graph. For that, I need a multidimensional object (or at least I think it is).</p>
  <p>The structure should look like this:</p>
  <pre><code>var datasets = {
          &quot;usa&quot;: {
              label: &quot;USA&quot;,
              data: [[1988, 483994], [1989, 479060], [1990, 457648], [1991, 401949], [1992, 424705], [1993, 402375], [1994, 377867], [1995, 357382], [1996, 337946], [1997, 336185], [1998, 328611], [1999, 329421], [2000, 342172], [2001, 344932], [2002, 387303], [2003, 440813], [2004, 480451], [2005, 504638], [2006, 528692]]
          },        
          &quot;russia&quot;: {
              label: &quot;Russia&quot;,
              data: [[1988, 218000], [1989, 203000], [1990, 171000], [1992, 42500], [1993, 37600], [1994, 36600], [1995, 21700], [1996, 19200], [1997, 21300], [1998, 13600], [1999, 14000], [2000, 19100], [2001, 21300], [2002, 23600], [2003, 25100], [2004, 26100], [2005, 31100], [2006, 34700]]
          }
  };
  </code></pre>
  <p>From my code-behind i've generated some lists looking like this (Not the same data, but dont mind that):</p>
  <pre><code>&lt;ul id=&quot;MOBILISATION&quot;&gt;
    &lt;li data-key=&quot;2012/3/27&quot;&gt;02:10&lt;/li&gt;
    &lt;li data-key=&quot;2012/3/28&quot;&gt;05:25&lt;/li&gt;
    &lt;li data-key=&quot;2012/3/29&quot;&gt;09:21&lt;/li&gt;
    &lt;li data-key=&quot;2012/3/30&quot;&gt;00:00&lt;/li&gt;
    &lt;li data-key=&quot;2012/3/31&quot;&gt;00:00&lt;/li&gt;
  &lt;/ul&gt;
  &lt;ul id=&quot;OPERATIONS&quot;&gt;
    &lt;li data-key=&quot;2012/3/27&quot;&gt;19:51&lt;/li&gt;
    &lt;li data-key=&quot;2012/3/28&quot;&gt;18:35&lt;/li&gt;
    &lt;li data-key=&quot;2012/3/29&quot;&gt;14:39&lt;/li&gt;
    &lt;li data-key=&quot;2012/3/30&quot;&gt;07:46&lt;/li&gt;
    &lt;li data-key=&quot;2012/3/31&quot;&gt;10:26&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  <p>Where &quot;USA/usa&quot; is &quot;MOBILISATION&quot;, &quot;1988&quot; is &quot;2012/3/27&quot; and &quot;483994&quot; is &quot;02:10&quot;. You get picture!!??</p>
  <p>I've tried writing some jQuery, but it obviously doesnt work:</p>
  <pre><code>    var objects = [];
      var array = [];
      var categoryName = &quot;&quot;;
      $('div#Container ul').each(function () {
          catName = $(this).attr('id');
          $('li', this).each(function () {
              array.push([new Date($(this).data('key')).getTime(), $(this).text()]);
          });
  
          objects.push({ categoryName: { label: categoryName, data: array} });
      });
      var datasets = objects;
  </code></pre>
  <p>As you can see i've used push to <code>objects</code> array. Clearly that is not giving me the result I want. Im kindda loosing whats up and down in this, as its the first time I'm working with jQuery objects.</p>
  <p>Whats the best solution for this?</p>