Hi
I am trying to update this chart with the code below the data is coming form a datatable and this only add data into on row so all other rows are not updates
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];
for (int i = 0; i < extractedData.Rows.Count; i++)
{
string insertedValue = extractedData.Rows[i][valuesUsed[5]].ToString();
if (insertedValue.Equals("-") || insertedValue.Equals(""))
{
insertedValue = “0”;
}
if (i<6)
{
fact.GetCell(0, 0, 1, “Newspapers”);
series.Values[i].Value = Math.Round(Convert.ToDouble(insertedValue), MidpointRounding.AwayFromZero);
}
else if (i < 12)
{
fact.GetCell(0, 0, 2, “Magazines”);
series.Values[count].Value = Math.Round(Convert.ToDouble(insertedValue), MidpointRounding.AwayFromZero);
count++;
}
else if ( i < 18)
{
fact.GetCell(0, 0, 3, “Television”);
series.Values[count1].Value = Math.Round(Convert.ToDouble(insertedValue), MidpointRounding.AwayFromZero);
count1++;
}
else if ( i < 24)
{
fact.GetCell(0, 0, 4, “Internet”);
series.Values[count2].Value = Math.Round(Convert.ToDouble(insertedValue), MidpointRounding.AwayFromZero);
count2++;
}
else if ( i < 30)
{
fact.GetCell(0, 0, 5, “Outdoor Media”);
series.Values[count3].Value = Math.Round(Convert.ToDouble(insertedValue), MidpointRounding.AwayFromZero);
count3++;
}
else if (i < 36)
{
fact.GetCell(0, 0, 6, “Cinema”);
series.Values[count4].Value = Math.Round(Convert.ToDouble(insertedValue), MidpointRounding.AwayFromZero);
count4++;
}
else if (i >= 36)
{
fact.GetCell(0, 0, 7, “Radio”);
series.Values[count5].Value = Math.Round(Convert.ToDouble(insertedValue), MidpointRounding.AwayFromZero);
count5++;
}