我正在使用c#,如何将图表的标题放在字符串变量中?c#把图表的标题放在字符串变量中
我使用的是委托所以这里是我的代码:
private void ChartTitle(object sender, MouseEventArgs e)
{
Chart Chart = (Chart)sender;
string title=Chart.Titles. ???
}
我正在使用c#,如何将图表的标题放在字符串变量中?c#把图表的标题放在字符串变量中
我使用的是委托所以这里是我的代码:
private void ChartTitle(object sender, MouseEventArgs e)
{
Chart Chart = (Chart)sender;
string title=Chart.Titles. ???
}
作为msdn documentation说,你应该添加一个标题是这样的:
Chart1.Titles.Add("My Chart"); // Titles text, not the name
Chart1.Titles.["Title1"].Name = "MyTitle"; // By default charts titles name is Title1, we rename it
然后,你可以得到值与:
string title = Chart1.Titles["MyTitle"].Text;
WinForms,WPF,ASP.NET WebFor ms,UWP? – Backs
'string title = Chart.Titles是什么? ''... –
和无论哪个框架...你看过文档吗?...第一步 –