I'm developing an application in C # using the Windows Form chart. I would like to know how to put the x-axis values as the caption of it.
string[]nomes={"eduardo", "jorge", "chris", "matheus" };
int[] idades = { 23, 10, 70, 80 };
List<int> numeros = new List<int>();
numeros.Add(23);
numeros.Add(10);
numeros.Add(70);
numeros.Add(100);
int maior = numeros.Max();
int menor = numeros.Min();
chart1.Titles.Add("Idades");
for (int i = 0; i < nomes.Length; i++)
{
//chart1.Series["Idades"]["PointWidth"] = "0.6";
//chart1.Series.Add(nomes[i]);
chart1.Legends.Add(new Legend(nomes[i]));
chart1.Series["Idades"].Points.AddXY(nomes[i], idades[i]);
if(numeros.ElementAt(i)==maior){
chart1.Series["Idades"].Points[i].Color = Color.Red;
}else if (numeros.ElementAt(i) == menor) {
chart1.Series["Idades"].Points[i].Color = Color.Yellow;
}
else
{
chart1.Series["Idades"].Points[i].Color = Color.Blue;
}
}