title: how to bind 2 table dynamic data in bar chart using ajax call in mvc c#?
body: <p>I am trying to show last 7 days count in the bar charts.for that I am using bar charts and asp.net mvc c#.I have created store procedure that return 2 tables form the database. Now in this page I can able to  show 1st table data.But no idea about how to show  2nd table data in the chart. Find table structure below</p>
  
  <p>This is my 1st return table data => </p>
  
  <pre><code>DateColumn | Count
  09-05-2017    10
  08-05-2017    05
  07-05-2017    20
  06-05-2017    4000
  05-05-2017    30
  04-05-2017    5000
  03-05-2017    40
  </code></pre>
  
  <p>This is my 2nd table data => </p>
  
  <pre><code>DateColumnForManual | TotalCountForManual
  09-05-2017             10
  08-05-2017             05
  07-05-2017             20
  06-05-2017             4000
  05-05-2017             30
  04-05-2017             5000
  03-05-2017              40
  </code></pre>
  
  <p>This is my Class in c# =></p>
  
  <pre><code>  public class Dashboard
    {
      public string DateColumn { get; set; }
  
      public int TotalCount { get; set; }
  
      public string DateColumnForManual { get; set; }
  
      public int TotalCountForManual { get; set; }
   } 
  </code></pre>
  
  <p>This is my status class=></p>
  
  <pre><code>public class Status
  {
      public bool Result { get; set; }
      public object Data { get; set; }        
  }
  </code></pre>
  
  <p>This is my Server side method =></p>
  
  <pre><code>public JsonResult GetCount()
      {
              Dashboard objDashboard = new Dashboard();
              var Count = objDashboard.GetDashboard();
              return Json(new { data = Count.Data }, JsonRequestBehavior.AllowGet);            
      } 
  </code></pre>
  
  <p>This My Dashboard.cs =></p>
  
  <pre><code> public Status GetDashboard()
       {
          Status Status = new Status();            
              DataSet ds = DataAccess.ExecuteDataset(Settings.ConnectionString(), "spGetDashboard");
  
              if (ds != null &amp;&amp; ds.Tables.Count &gt; 0)
              {
                  List&lt;Dashboard&gt; ListActivity = new List&lt;Dashboard&gt;();
                  for (int i = 0; i &lt; ds.Tables[0].Rows.Count; i++) // this is my 1st table return 
                  {
                      Dashboard objActivity = new Dashboard();
                      objActivity.DateColumn = ds.Tables[0].Rows[i]["DateColumn"].ToString();
                      objActivity.TotalCount = Convert.ToInt32(ds.Tables[0].Rows[i]["TotalCount"]);
                      ListActivity.Add(objActivity);
                  }
                  for (int i = 0; i &lt; ds.tables[1].rows.count; i++) // this is my 2nd table return
                  {
                     Dashboard objactivity = new Dashboard();
                     objactivity.datecolumnformanual = ds.tables[1].rows[i]["datecolumnformanual"].tostring();
                     objactivity.totalcountformanual = convert.toint32(ds.tables[1].rows[i]["totalcountformanual"]);
                     listactivity.add(objactivity);
                  }
                  Status.Data = ListActivity;
                  Status.Result = true;
              }
              else
              {
                  Status.Result = false;
              }           
          return Status;
      }
  </code></pre>
  
  <p>here my ajax call =></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function () {        
  $.ajax({
      url: 'Home/GetCount',
      dataType: "json",
      type: "GET",
      contentType: 'application/json; charset=utf-8',
      async: false,
      processData: false,
      cache: false,
      delay: 15,
      success: function (data) {
            var arrlable = new Array();
              var arrdata = new Array();
              var arrdataForManual = new Array();
  
              for (var i = 0; i &lt; data.data.length; i++) {
                  arrlable.push(data.data[i].DateColumn);
                  arrdata.push(data.data[i].TotalCount);
                  //arrdataForManual.push(data.data[i].TotalCountForManual);
              }
              AutoFollow(arrlable, arrdata);
      },
      error: function (xhr) {
          alert('error');
      }
  });
  </code></pre>
  
  <p>});</p>
  
  <pre><code> function AutoFollow(arrlable, arrdata)
   {
  var ctx = document.getElementById("myChart").getContext('2d');
  var myChart = new Chart(ctx, {
      type: 'bar',
      data: {
          labels: arrlable, // here show date
          datasets: [{
              label: 'AutoFollow',
              data: arrdata
              backgroundColor: "rgba(153,255,51,1)"
          }, {
              label: 'Manual',
              data: [30, 29, 5, 5, 20, 3, 10], // here i want to show 2nd table data
              backgroundColor: "rgba(255,153,0,1)"
          }]
      },            
  });
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/wewf0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wewf0.png" alt="enter image description here"></a></p>
  
  <p>here in the sketch i am show autofollow count is dynamic show i want also want manual count from the database and this come from 2nd tabel data.</p>
  
  <p>here above i show the my whole code and i want to show my 2nd table data in the bar charts any one have the idea how can do that please let me?</p>