int count = 0;
int count1 = 0;
int count2 = 0;
int count3 = 0;
int count4 = 0;
int count5 = 0;
ChartDataCellFactory fact = chart.ChartData.ChartDataCellFactory;
ChartSeriesEx series = chart.ChartData.Series[0];
fact.GetCell(0, 0, 1, "Newspapers");
fact.GetCell(0, 0, 2, "Magazines");
fact.GetCell(0, 0, 3, "Television");
fact.GetCell(0, 0, 4, "Internet");
fact.GetCell(0, 0, 5, "Outdoor Media");
fact.GetCell(0, 0, 6, "Cinema");
fact.GetCell(0, 0, 7, "Radio");
for (int i = 0; i < extractedData.Rows.Count; i++)
{
string insertedValue = extractedData.Rows[i][valuesUsed[5]].ToString();
if (i<6)
{
series.Values.Add(fact.GetCell(0, i + 1, 1, Math.Round(Convert.ToDouble(insertedValue), MidpointRounding.AwayFromZero)));
}
else if (i < 12)
{
series.Values.Add(fact.GetCell(0, count + 1, 2, Math.Round(Convert.ToDouble(insertedValue), MidpointRounding.AwayFromZero)));
count++;
}
else if ( i < 18)
{
series.Values.Add(fact.GetCell(0, count1 + 1, 3, Math.Round(Convert.ToDouble(insertedValue), MidpointRounding.AwayFromZero)));
count1++;
}
else if ( i < 24)
{
series.Values.Add(fact.GetCell(0, count2 + 1, 4, Math.Round(Convert.ToDouble(insertedValue), MidpointRounding.AwayFromZero)));
count2++;
}
else if ( i < 30)
{
series.Values.Add(fact.GetCell(0, count3 + 1, 5, Math.Round(Convert.ToDouble(insertedValue), MidpointRounding.AwayFromZero)));
count3++;
}
else if (i < 36)
{
series.Values.Add(fact.GetCell(0, count4 + 1, 6, Math.Round(Convert.ToDouble(insertedValue), MidpointRounding.AwayFromZero)));
count4++;
}
else if (i <42)
{
series.Values.Add(fact.GetCell(0, count5 + 1, 7, Math.Round(Convert.ToDouble(insertedValue), MidpointRounding.AwayFromZero)));
count5++;
}
}