title: Multiple Charts In ASP.NET MVC Razor
body: <p>My Controller code:</p>
  
  <pre><code>public ActionResult Index()
  {
          Session["GetAllChart"] = GetAllCharts();
          return View();
  }
  public List&lt;Chart&gt; GetAllCharts(int patientId = 1)
      {
          List&lt;Chart&gt; allCharts = new List&lt;Chart&gt;();
          foreach (PatientConditionColumnName patientConditionColumnName in patientConditionBll.GetPatientColumnNameList())
          {
              allCharts.Add(GetChart(patientId, patientConditionColumnName.ColumnName));
          }
          return allCharts;
      }
  
  public Chart GetChart(int patientId, string parameter)
      {
          ArrayList xValue = new ArrayList();
          ArrayList yValue = patientConditionBll.GetYValues(patientId, parameter);
  
          List&lt;PatientCondition&gt; patientConditionAll = context.PatientConditions.Where(m =&gt; m.PatientId == patientId).ToList();
          patientConditionAll.ForEach(m =&gt; xValue.Add(m.time));
  
          Chart chart = new Chart(width: 600, height: 400, theme: ChartTheme.Blue)
              .AddTitle("y axis represents " + parameter + " value")
              .AddLegend("x axis represents time")
              .AddSeries("Default", chartType: "Line", xValue: xValue, yValues: yValue);
  
  
          return chart;
      }
  </code></pre>
  
  <p>in Index.cshtml</p>
  
  <pre><code>@{
    List&lt;Chart&gt; chartsAll = Session["GetAllChart"] as List&lt;Chart&gt;;}
  
  
  &lt;div class="col-md-4"&gt;
      &lt;section id="showChart"&gt;
  
          @if (chartsAll != null)
          {
                  foreach (var aChart in chartsAll)
                  {
                      &lt;div&gt; @aChart.Write(format: "png")&lt;/div&gt;
                  }
          }
  
      &lt;/section&gt;
  </code></pre>
  
  <p>There are almost 29 parameters and i want to display individual chart for each of the parameter (such as HR, Urine, total intake) with respect to time. But only the first one Spo2 chart is shown.
  How can i display list of all parameter individual chart with respect to time in a page?
  my source code download including database: <a href="https://drive.google.com/open?id=0BySGGgZO1jMVMzBfc3FER1FlQ0k" rel="nofollow noreferrer">https://drive.google.com/open?id=0BySGGgZO1jMVMzBfc3FER1FlQ0k</a></p>