Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change Y axis Label font size?

I want to change the Y-axis label font size.

I tried...

AxisY LineColor="64, 64, 64, 64" LabelAutoFitMinFontSize="5"
   LabelStyle Font="NanumGothic, 5pt"

and

Chart1.ChartAreas["ChartArea1"].AxisX.LabelStyle.Font.Size = 5;

but it doesn't work. Its size cannot be modified even though I extend or minify it.

Please help me...!! :)

like image 929
Moonil Kim Avatar asked Jul 04 '12 02:07

Moonil Kim


2 Answers

You seem to have forgotten to change auto fit style for this axis. It default setting replaces your font size

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);
like image 115
Oleg Avatar answered Sep 18 '22 05:09

Oleg


You try this may be its working

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

Set Title Color

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

like image 22
Raheel Avatar answered Sep 22 '22 05:09

Raheel