Click here to Skip to main content
15,937,127 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
DataRow newrowPassCount = dtoutput.NewRow();
                DataRow newrowReworkCount = dtoutput.NewRow();

                int pprevcount = 0;
                int rprevcount = 0;
                string ppcount;
                foreach (string columnName in columnNames)
                {
                    Chart1.Series["Series1"].XValueMember = columnName;
                    int pcount = lstData.Where(k => k.FileName == columnName).Count(k =>  k.status.Trim() == "PASS");

                    ppcount = "Pass: " + (Convert.ToString(pcount - pprevcount));
                    newrowPassCount[columnName] = ppcount;
                    Chart1.Series["Series1"].YValueMembers = Convert.ToString(ppcount);
                    pprevcount = pcount;
                    rprevcount = rcount;

                }


                dtoutput.Rows.Add(newrowPassCount);
                dtoutput.Rows.Add(newrowReworkCount);

                Chart1.DataSource = dtoutput;
                Chart1.DataBind();


I still getting error in showing chart...
i create a new datatable which is dtoutput below here and i want to show it in chart..
test1|test2|test3
125 |130 |150
test1,test2,test3 is my columnName from my code above which i want to show it as xvaluemembers
125,130,150 is my new row that created in the dtoutput which i want to show it in Yvaluemembers

can anyone help me with the error.. is my chart code above correct?...yvaluemember is to get data from column , is there code that can get data from row?
Posted
Updated 6-Jan-14 2:06am
v2
Comments
ZurdoDev 6-Jan-14 7:59am    
What's the error?
acing wei 6-Jan-14 8:28am    
Column with name '125' was not found.
i think because yvaluemembers is read from column..where my 125 is in my row..
anyway to get value from row?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900