将轴名称添加到图表C# [英] Add axis name into chart c#
本文介绍了将轴名称添加到图表C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用C#使用 winforms .
我使用图表,我想在代码中设置X轴和Y轴的标题.我尝试过
I use chart and I want to set the titles of the X- and Y-axis in code. I tried
chart1.chartarea(0).axisX.title = "xxx"
但是它不起作用,我也不知道为什么.
but it does't work and I don't know why.
推荐答案
我正在使用Web上的图表控件,并通过以下方式设置X和Y轴标题.
I am using the charts control on the web and setting the X and Y axis titles are done in the following way.
我认为Winforms的API相同.
I assume the API would be the same for winforms.
var chartArea = new ChartArea("MyChart");
...
chartArea.AxisX.Title = "xxx";
chartArea.AxisY.Title = "yyy";
这篇关于将轴名称添加到图表C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文