title: display two items data in Ms Chart Control VB.Net
body: <p>I'm new to MS Chart control. I want to display sql conditional result in chart control. This is my codes</p>
  <p>Dim strQry As String = &quot;SELECT format(sDate, 'MMMM-YYYY') AS [Month], iCode as [Item], Sum(iQty) AS [Total Qty] FROM Sales WHERE iCode ='DJ100106' OR iCode='DJ100107' GROUP BY format(sDate, 'MMMM-YYYY'), icode ORDER BY cDate(format(sDate, 'MMMM-YYYY'))&quot;</p>
  <pre><code>    Dim dt As New DataTable
      Dim da As New OleDbDataAdapter(sqlQry, Conn)
  
      da.Fill(dt)
      Chart1.Series(0).Color = Color.YellowGreen
      Chart1.Series(0).XValueMember = &quot;Month&quot;
      Chart1.Series(0).YValueMembers = &quot;Total Qty&quot;
      Chart1.Series(0).IsValueShownAsLabel = True
      Chart1.DataSource = dt
  </code></pre>
  <p>For one condition in WHERE clause, chart control displays the bars correctly. If I add more condition such as &quot;OR iCode = 'DJ100107'&quot;, chart control displays inappropriate bars and values in X axis.</p>
  <p>I want to compare these two items (DJ100106 and DJ100107) sold in every month in chart. Grid control displays the exact result what I want. But the chart control doesn't. (As shown in the attached image). I am using VB.Net 2012, MS Access Database 2007
  Can anyone help me how to solve this?
  Thank you
  <a href="https://i.stack.imgur.com/pZUmY.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pZUmY.jpg" alt="Two Series" /></a></p>