开发者

ASP.NET Chart Control - Axis labels

开发者 https://www.devze.com 2023-01-19 08:06 出处:网络
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?

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.


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));


Try this:

Chart1.ChartAreas["ChartArea1"].AxisX.Title = "Axis X Name"
0

精彩评论

暂无评论...
验证码 换一张
取 消