如何更改条形图中标签的大小
How to change the size of label in bar chart
如何更改条形图中轴上只有一个标签的大小。我只想更改来自字符串的第一个标签。
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);
在您发布的代码中,假设您要将 "Pursue_Noble_Goals" 的第一个点轴标签更改为 "Pursue_Noble_Thoughts" 之类的内容,以下代码行应该可以解决问题:
chart.Series[1].Points[0].AxisLabel = "Pursue_Noble_Thoughts";
如何更改条形图中轴上只有一个标签的大小。我只想更改来自字符串的第一个标签。
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);
在您发布的代码中,假设您要将 "Pursue_Noble_Goals" 的第一个点轴标签更改为 "Pursue_Noble_Thoughts" 之类的内容,以下代码行应该可以解决问题:
chart.Series[1].Points[0].AxisLabel = "Pursue_Noble_Thoughts";