如何改变条形图中标签的大小

本文关键字:标签 条形图 何改变 改变 | 更新日期: 2023-09-27 18:01:23

如何更改条形图中axisX上只有一个标签的大小?我想只改变来自string的第一个标签。

c#代码:

string pursue = _getLabel(reportLanguage, "Pursue_Noble_Goals");
string increase = _getLabel(reportLanguage, "Increase_Empathy");                  
string give = _getLabel(reportLanguage, "Give_Yourself");
chart.Series[1].Points.AddXY(pursue, Convert.ToDouble(_removeSomething(qas.PursueNobleGoalsScore, _str)));
chart.Series[1].Points[0].Color = System.Drawing.Color.FromArgb(128, 128, 128);                                       
chart.Series[1].Points.AddXY(increase, Convert.ToDouble(_removeSomething(qas.IncreaseEmpathyScore, _str)));
chart.Series[1].Points[1].Color = System.Drawing.Color.FromArgb(192, 192, 192);
chart.Series[1].Points.AddXY(give, Convert.ToDouble(_removeSomething(qas.GiveYourselfScore, _str)));                                     
chart.Series[1].Points[2].Color = System.Drawing.Color.FromArgb(255, 216, 25, 33);
chart.Series[1].Points.AddXY(exercise, Convert.ToDouble(_removeSomething(qas.ExcerciseOptimismScore, _str)));
chart.Series[1].Points[3].Color = System.Drawing.Color.FromArgb(255, 216, 25, 33);

如何改变条形图中标签的大小

在您发布的代码中,假设您想将第一个点轴标签"追击_诺贝尔_目标"更改为类似"追击_诺贝尔_思想"的内容,下面的代码行应该可以做到:

chart.Series[1].Points[0].AxisLabel = "Pursue_Noble_Thoughts";