title: D3 multi-series line chart from pivoted JSON
body: <p>There is a great example of a multi-series line chart here <a href="http://bl.ocks.org/mbostock/3884955" rel="noreferrer">http://bl.ocks.org/mbostock/3884955</a> and if the tsv data were laid out I'm sure it would look something like this:</p>
  
  <pre><code>[
    {
      "date": "20111001",
      "New York": "63.4",
      "San Francisco": "62.7",
      "Austin": "72.2"
    },
    {
      "date": "20111002",
      "New York": "58.0",
      "San Francisco": "59.9",
      "Austin": "67.7"
    },
    {
      "date": "20111003",
      "New York": "53.3",
      "San Francisco": "59.1",
      "Austin": "69.4"
    }
  ]
  </code></pre>
  
  <p>The issue I have is that I may not always know the keys, cities in this case, and would not want a solution that stores the cities in the key.</p>
  
  <p>If my data looked like this:</p>
  
  <pre><code>[
      {
          "City": "New York",
          "Data": [
              {
                  "Date": "20111001",
                  "Value": "63.4"
              },
              {
                  "Date": "20111002",
                  "Value": "58.0"
              },
              {
                  "Date": "20111003",
                  "Value": "53.3"
              }
          ]
      },
      {
          "City": "San Francisco",
          "Data": [
              {
                  "Date": "20111001",
                  "Value": "62.7"
              },
              {
                  "Date": "20111002",
                  "Value": "59.9"
              },
              {
                  "Date": "20111003",
                  "Value": "59.1"
              }
          ]
      },
      {
          "City": "Austin",
          "Data": [
              {
                  "Date": "20111001",
                  "Value": "72.2"
              },
              {
                  "Date": "20111002",
                  "Value": "67.7"
              },
              {
                  "Date": "20111003",
                  "Value": "69.4"
              }
          ]
      }
  ]
  </code></pre>
  
  <p>Is there a way to map my data to the first format OR what would I need to change in the code to get the same multi-series line chart?</p>
  
  <p>Here is a jsfiddle <a href="http://jsfiddle.net/p8S7p/" rel="noreferrer">http://jsfiddle.net/p8S7p/</a></p>