5

I am trying out THIS .NET MS Chart control.

Could someone who knows about it tell me how to set the axis labels without using data bindings?

eg. If there are 3 columns, I am looking for something like this

Chart1.AxisX.Labels = ["First", "Second", "Third"];

Thanks in advance.

dawg
  • 98,345
  • 23
  • 131
  • 206
Aximili
  • 28,626
  • 56
  • 157
  • 216

2 Answers2

8

This does it

    for (int c = 1; c < numOfColumns; c++)
      chart.ChartAreas[0].AxisX.CustomLabels.Add(new CustomLabel(c - 0.5, c + 0.5, labels[c], 0, LabelMarkStyle.None));
Aximili
  • 28,626
  • 56
  • 157
  • 216
1

Try this:

Chart1.ChartAreas["ChartArea1"].AxisX.Title = "Axis X Name"
Nakilon
  • 34,866
  • 14
  • 107
  • 142