title: Django jquery flot chart multiple series
body: <p>I use Flot for chart in my Django app. I want to draw every day a chart that has many data series (lines chart). Each day, the serial number could change and I don't know how to handle this with flot. My code is more or less this:</p>
  
  <p>test.py </p>
  
  <pre><code> data_day_1 = [[1,56],[2,65],[3,45]]
   data_day_2 = [[1,45],[2,23],[3,89]]
   return render_to_response('test.html', {'data_day_1': data_day_1,
                                           'data_day_2': data_day_2,
                                           },
                            context_instance=RequestContext(request))       
  </code></pre>
  
  <p>test.html</p>
  
  <pre><code> &lt;div class="portlet-body"&gt;
       &lt;div id="site_statistics" class="chart"&gt;&lt;/div&gt;
   &lt;/div&gt;
  
   &lt;script type="text/javascript"&gt;
   var data1 = [];
   {% for x, y in data_day_1 %}
   data1.push([{{x}},{{y}}])
   {% endfor %} 
  
   var data2 = [];
   {% for x, y in data_day_2 %}
   data2.push([{{x}},{{y}}])
   {% endfor %} 
  
   $(function () {    
      var Options = { lines: {show: true},                
                            }
          $.plot($("#site_statistics"), 
          [{data: data1,
        color: "#454d7d",
        points: {show: true},
        label: "data_day_1", 
        },
       {data: data2,
        color: "#454d7d",
        points: {show: true},
        label: "data_day_2", 
        }
       ],Options);
  });     
  </code></pre>
  
  <p></p>
  
  <p>Another day I might have another set (eg data_day_3) and do not know how to do. How can I do to manage the transfer of data and the design of the new line dynamically? Thanks for your help.</p>