title: Why is the following pie chart only displaying 1/3 of the sql count condition?
body: <p>Hi sorry to bother everyone again. Can someone please take a look at my code and correct me? I cannot seem to achieve the result i want in <strong>image in 3)</strong>. My chart is displaying only 1/3 of the count conditions. How can i amend the following line so that i can read all of the count conditions to display the image in 3)?</p>
  
  <pre><code>private void BindChart()
  {
      string query3 = string.Format("select count(case when tempValue &lt; 24 then 1 end) as Cold, count(case when tempValue between 24 and 30 then 1 end) as Warm, count(case when tempValue &gt; 30 then 1 end) as Hot FROM Datacentre");
      DataTable dt = GetData3(query3);
  
      string[] x = new string[] { "&lt; 24 Degrees", "24 - 30 Degrees", "&gt; 30 Degrees" };
      foreach (DataRow row in dt.Rows)
      {
          foreach (var value in x)
          {
              PieChart1.PieChartValues.Add(new AjaxControlToolkit.PieChartValue
              {
                  Category = value,
                  Data = Convert.ToDecimal(row["Cold"]) //reads 3 objects
              });//PROBLEM: but only displays total count of 18 for everything
          }
      }
  
      this.PieChart1.Enabled = true;
      this.PieChart1.Visible = true;
      this.PieChart1.DataBind();
  }
  </code></pre>
  
  <p><strong>1) Here is what i retrieved:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/4InhW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4InhW.png" alt="enter image description here"></a></p>
  
  <p><strong>2) Here is my chart output:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/yZLNr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yZLNr.png" alt="enter image description here"></a></p>
  
  <p><strong>3) This is the result what i want:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/GshuY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GshuY.png" alt="enter image description here"></a></p>