I am trying to fill in a Chart with manual data, the code I have tried is the following:
int[,] horas = new int[,] { { 0, 1 },{ 1, 1 }, { 2, 0 }, { 3, 1 }, { 4, 0 }, { 5, 1 } };
protected void Page_Load(object sender, EventArgs e)
{
Chart1.Series.Clear();
Chart1.DataSource = horas;
var series1 = new Series
{
Name = "Prueba1",
Color = System.Drawing.Color.Green,
IsVisibleInLegend = true,
IsXValueIndexed = true,
ChartType = SeriesChartType.Line
};
series1.AxisLabel = "Axis";
for (int i = 0; i < horas.GetLength(0); i++)
{
series1.Points.AddXY(horas[i,0],horas[i,1]);
}
Chart1.DataBind();
}
However, nothing comes out on the page, thank you.