Code
DataSet ds = new DataSet();
con.Open();
SqlDataAdapter adapt = new SqlDataAdapter("select top 10 p.customername, ISNULL(SUM(c.total),0) as total from table_customerpurchases as c Left join table_customers as p on p.customerid = c.cid where cid!='Default' and cid!='c10022' group by customername order by total desc", con);
adapt.Fill(ds);
chart1.DataSource = ds;
chart1.Series["Customers"].XValueMember = "customername";
chart1.Series["Customers"].XValueType = ChartValueType.String;
chart1.Series["Customers"].YValueMembers = "total";
chart1.Series["Customers"].YValueType = ChartValueType.Double;
chart1.Titles.Add("Customers Purchases Chart");
chart1.Series["Customers"].IsValueShownAsLabel = true;
con.Close();
As you can see when i put break there and see in dataset visualizer; All data is filled in there
> Problem Description
I don't know where the problem is that it is showing column bar but skips 'XValueMember' value. Also why it is not creating separate column line for every 'XValueMember'.