如何改变Y轴标签字体大小?

Moo*_*Kim 6 asp.net size fonts label mschart

我想更改Y轴标签字体大小.

我试过了...

AxisY LineColor="64, 64, 64, 64" LabelAutoFitMinFontSize="5"
   LabelStyle Font="NanumGothic, 5pt"
Run Code Online (Sandbox Code Playgroud)

Chart1.ChartAreas["ChartArea1"].AxisX.LabelStyle.Font.Size = 5;
Run Code Online (Sandbox Code Playgroud)

但它不起作用.即使我扩展或缩小它的大小也无法修改.

请帮我...!!:)

Ole*_*leg 12

您似乎忘记更改此轴的自动调整样式.默认设置将替换您的字体大小

Chart1.ChartAreas.["ChartArea1"].AxisY.LabelAutoFitStyle 
    = LabelAutoFitStyles.None;
Chart1.ChartAreas.["ChartArea1"].AxisX.LabelStyle.Font 
    = new System.Drawing.Font("Trebuchet MS", 2.25F, System.Drawing.FontStyle.Bold);
Run Code Online (Sandbox Code Playgroud)


Rah*_*eel 8

你试试这可能是它的工作

Chart1.ChartAreas["ChartArea1"].AxisX.TitleFont = new Font("your required font",uyour required size, FontStyle.your required style);
Run Code Online (Sandbox Code Playgroud)

设置标题颜色

Chart1.ChartAreas ["ChartArea1"].AxisX.ForeColor = Color.Red;


Gre*_*reg 6

而不是尝试直接更改字体大小,而是为您指定所需样式的字体.例如:

Chart1.ChartAreas.["ChartArea1"].AxisX.LabelStyle.Font = new System.Drawing.Font("Trebuchet MS", 2.25F, System.Drawing.FontStyle.Bold);
Run Code Online (Sandbox Code Playgroud)

根据您正在做的事情,您可能还希望将IsLabelAutoFit设置为false.