D3 Multi Series Line Chart

by akashdmukherjee

CSS

body {
        font: 10px sans-serif;
    }
  .axis line {
        fill: none;
        stroke: red;
        shape-rendering: crispEdges;
    }

  .axis path {
        fill: none;
        stroke: blue;
        shape-rendering: crispEdges;
    }
  
    
    .element text {
        text-anchor: end;
    }

    .area {
        opacity: 0.7;
    }

JavaScript

var data = {
    "Series 1": {
        "20141020": 3.5003987252672744,
        "20141019": 2.505802351020492,
        "20141018": 1.511804171940014,
        "20141015": 1.466520821512944,
        "20141014": 2.458051096911987,
        "20141017": 0.518412786499141,
        "20141016": 0.4743643618143949,
        "20141013": 3.4489507475146013},
    "Series 2": {
        "20141008": 3.386547593121662,
        "20141009": 2.1369256424188166,
        "20141011": 0.3631764039020311,
        "20141010": 0.8870161087572228,
        "20141013": 2.8643781772248076,
        "20141012": 1.6136442355091276},
    "Series 3": {
        "20141024": 1.041445076319178,
        "20141025": 1.1241181263211502,
        "20141026": 1.38667149365412,
        "20141027": 1.818787980672198,
        "20141020": 2.5807963840540538,
        "20141021": 1.9209716474825598,
        "20141022": 1.4397443637179492,
        "20141023": 1.1457284782715362,
        "20141028": 2.4079290114153764,
        "20141029": 3.1402443065157684,
        "20141019": 3.4040698638675053},
    "Series 4": {
        "20141015": 0.6342340828370823,
        "20141014": 0.5870678384520431,
        "20141017": 3.0054047120678433,
        "20141016": 1.8435837647016058,
        "20141011": 3.997287602433431,
        "20141013": 1.786070641215474,
        "20141012": 2.9316731724834995},
    "Series 5": {
        "20141024": 2.1140684266577807,
        "20141025": 2.0313953766558086,
        "20141026": 1.7688420093228387,
        "20141027": 1.3367255223047607,
        "20141020": 0.574717118922905,
        "20141021": 1.234541855494399,
        "20141022": 1.7157691392590095,
        "20141023": 2.0097850247054225,
        "20141030": 0.8458214720297121,
        "20141028": 0.7475844915615824,
        "20141029": 0.015269196461190404,
        "20141019": 0.24855636089054656,
        "20141018": 1.2136523216203159,
        "20141017": 2.2931197800781717,
        "20141016": 3.4549407274444093}
}

var margin = {top:...