I am pretty new to pie charts and i have one that displays seconds to hh:mm:ss but I also need the username to be included as well here is my code.
string easystone = ConfigurationManager.ConnectionStrings["easystone"].ConnectionString;
SqlConnection con = new SqlConnection(easystone);
SqlDataAdapter graph = new SqlDataAdapter("SELECT[User] , sum(time) as [time] FROM avgtime3 group by[user]", con);
DataTable graphdata = new DataTable();
graph.Fill(graphdata);
chart1.DataSource = graphdata;
chart1.ChartAreas["ChartArea1"].AxisX.Title = "";
foreach (DataRow row in graphdata.Rows)
{
int total = (int)row["time"];
int index = chart1.Series["Series1"].Points.AddXY(row["User"], new object[] { total });
chart1.Series["Series1"].Points[index].Label = // I need the username to go here.
chart1.Series["Series1"].Points[index].Label = string.Format("{0:00}:{1:00}:{2:00}", (total / 60) / 60, (total / 60) % 60, total % 60);
}
Prefix the user name along with time.
chart1.Series["Series1"].Points[index].Label = row["User"].ToString() + " : " + string.Format("{0:00}:{1:00}:{2:00}", (total / 60) / 60, (total / 60) % 60, total % 60);