Feroz Khan

Feroz Khan

  • 1.4k
  • 292
  • 86.3k

i am trying to create Chart in C#

Aug 23 2016 5:07 AM
Hi All, 
 
i am using below code creating chart in c# through DataGridview but i am facing some issue
from gridview all rows graph not showing just one row graph showing. please check below my code and attached picture.
 
foreach (DataGridViewRow row in datagridview.Rows)
{
Series S = chartBpComplaince.Series.Add(row.Cells[4].Value.ToString());
S.Points.AddXY(row.Cells[2].Value.ToString(), row.Cells[3].Value.ToString());
S.ChartType = SeriesChartType.Column;
S.IsValueShownAsLabel = true;
}
 
Gridview Data
 
   0        -   1    -   2     -   3      -     4
10001   - PAK - SUP - 80.83 - June-2016
10002 - PAK - BJB - 90.48 - June-2016
10003 - PAK - DES - 94.72 - June-2016
10004 - PAK - ZYK - 95.1   - June-2016
10005 - PAK - BLA - 95.33 - June-2016
10006 - PAK - MOD - 95.33 - June-2016
10007 - PAK - NKR - 95.83 - June-2016
10008 - PAK - MON - 96.05 - June-2016
10009 - PAK - OXO - 96.67 - June-2016
10010 - PAK - UND - 96.67 - June-2016
10011 - PAK - CEL -    97    - June-2016
 

Attachment: GridviewError.rar

Answers (2)