Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Chart Control - Axis labels

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.

like image 986
Aximili Avatar asked Oct 06 '10 05:10

Aximili


2 Answers

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));
like image 139
Aximili Avatar answered Sep 21 '22 18:09

Aximili


Try this:

Chart1.ChartAreas["ChartArea1"].AxisX.Title = "Axis X Name"
like image 31
Rob-MakeSoftware Avatar answered Sep 20 '22 18:09

Rob-MakeSoftware